/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('gemp', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ProblemLevelGroupValue = {
  childRuleRelation?: int32(name='childRuleRelation'),
  matchCount?: long(name='matchCount'),
  timeWindow?: long(name='timeWindow'),
  timeWindowUnit?: string(name='timeWindowUnit'),
  enableUpgrade?: boolean(name='enableUpgrade'),
  upgradeTimeWindow?: long(name='upgradeTimeWindow'),
  upgradeTimeWindowUnit?: string(name='upgradeTimeWindowUnit'),
}

model DataProblemLevelGroupValue = {
  childRuleRelation?: int32(name='childRuleRelation'),
  matchCount?: long(name='matchCount'),
  timeWindow?: long(name='timeWindow'),
  timeWindowUnit?: string(name='timeWindowUnit'),
  enableUpgrade?: boolean(name='enableUpgrade'),
  upgradeTimeWindow?: long(name='upgradeTimeWindow'),
  upgradeTimeWindowUnit?: string(name='upgradeTimeWindowUnit'),
}

model DataValue = {
  code?: string(name='code', example='SMS'),
  description?: string(name='description'),
  configDescription?: string(name='configDescription'),
  configCode?: string(name='configCode', example='PROBLEM_REASON_DISASTER'),
  parentCode?: string(name='parentCode', example='PROBLEM_REASON'),
  configKey?: string(name='configKey', example='2'),
  configValue?: string(name='configValue'),
  requirement?: boolean(name='requirement', example='true'),
}

model AddProblemServiceGroupRequest {
  problemId?: long(name='problemId', example='10'),
  serviceGroupIds?: [ long ](name='serviceGroupIds'),
}

model AddProblemServiceGroupResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='5AD6E6BC-2582-4E0E-832D-52CB1B922253'),
}

model AddProblemServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddProblemServiceGroupResponseBody(name='body'),
}

/**
 * @summary 添加故障协同组
 *
 * @param request AddProblemServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddProblemServiceGroupResponse
 */
async function addProblemServiceGroupWithOptions(request: AddProblemServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProblemServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.serviceGroupIds)) {
    body['serviceGroupIds'] = request.serviceGroupIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddProblemServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/addServiceGroup`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 添加故障协同组
 *
 * @param request AddProblemServiceGroupRequest
 * @return AddProblemServiceGroupResponse
 */
async function addProblemServiceGroup(request: AddProblemServiceGroupRequest): AddProblemServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return addProblemServiceGroupWithOptions(request, headers, runtime);
}

model BillingStatisticsResponseBody = {
  requestId?: string(name='RequestId'),
  data?: {
    appUserCount?: long(name='appUserCount'),
    appUserCountFree?: long(name='appUserCountFree'),
    emailSend?: long(name='emailSend'),
    emailSendFree?: long(name='emailSendFree'),
    escalationPlanCount?: long(name='escalationPlanCount'),
    escalationPlanCountFree?: long(name='escalationPlanCountFree'),
    eventReportApi?: long(name='eventReportApi'),
    eventReportApiFree?: long(name='eventReportApiFree'),
    hasScheduleServiceGroupCount?: long(name='hasScheduleServiceGroupCount'),
    hasScheduleServiceGroupCountFree?: long(name='hasScheduleServiceGroupCountFree'),
    imMsgSend?: long(name='imMsgSend'),
    imMsgSendFree?: long(name='imMsgSendFree'),
    ruleCount?: long(name='ruleCount'),
    ruleCountFree?: long(name='ruleCountFree'),
    smsSend?: long(name='smsSend'),
    smsSendFree?: long(name='smsSendFree'),
    subscriptionNotifyCount?: long(name='subscriptionNotifyCount'),
    subscriptionNotifyCountFree?: long(name='subscriptionNotifyCountFree'),
    type?: boolean(name='type'),
    voiceSend?: long(name='voiceSend'),
    voiceSendFree?: long(name='voiceSendFree'),
  }(name='data'),
}

model BillingStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BillingStatisticsResponseBody(name='body'),
}

/**
 * @summary 计费展示
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BillingStatisticsResponse
 */
async function billingStatisticsWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): BillingStatisticsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'BillingStatistics',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/charging/details`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 计费展示
 *
 * @return BillingStatisticsResponse
 */
async function billingStatistics(): BillingStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return billingStatisticsWithOptions(headers, runtime);
}

model CancelProblemRequest {
  cancelReason?: long(name='cancelReason', example='取消原因'),
  cancelReasonDescription?: string(name='cancelReasonDescription', example='原因描述'),
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  problemId?: long(name='problemId', example='312'),
  problemNotifyType?: long(name='problemNotifyType', example='PROBLEM_NOTIFY'),
}

model CancelProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='B81E84B5-8FD1-45F3-969A-B5067AADCFFF'),
}

model CancelProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelProblemResponseBody(name='body'),
}

/**
 * @summary 故障取消
 *
 * @param request CancelProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelProblemResponse
 */
async function cancelProblemWithOptions(request: CancelProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CancelProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cancelReason)) {
    body['cancelReason'] = request.cancelReason;
  }
  if (!Util.isUnset(request.cancelReasonDescription)) {
    body['cancelReasonDescription'] = request.cancelReasonDescription;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/cancel`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障取消
 *
 * @param request CancelProblemRequest
 * @return CancelProblemResponse
 */
async function cancelProblem(request: CancelProblemRequest): CancelProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelProblemWithOptions(request, headers, runtime);
}

model CheckWebhookRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  webhook?: string(name='webhook', example='https://oapi.dingtalk.com/robot/send?access_token=XXX'),
  webhookType?: string(name='webhookType', example='DING_GROUP'),
}

model CheckWebhookResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model CheckWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckWebhookResponseBody(name='body'),
}

/**
 * @summary 校验webhook地址
 *
 * @param request CheckWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckWebhookResponse
 */
async function checkWebhookWithOptions(request: CheckWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckWebhookResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.webhook)) {
    body['webhook'] = request.webhook;
  }
  if (!Util.isUnset(request.webhookType)) {
    body['webhookType'] = request.webhookType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CheckWebhook',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/check/webhook`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验webhook地址
 *
 * @param request CheckWebhookRequest
 * @return CheckWebhookResponse
 */
async function checkWebhook(request: CheckWebhookRequest): CheckWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkWebhookWithOptions(request, headers, runtime);
}

model ConfirmIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='101'),
}

model ConfirmIntegrationConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model ConfirmIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfirmIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 确认集成配置
 *
 * @param request ConfirmIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ConfirmIntegrationConfigResponse
 */
async function confirmIntegrationConfigWithOptions(request: ConfirmIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ConfirmIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/confirm`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 确认集成配置
 *
 * @param request ConfirmIntegrationConfigRequest
 * @return ConfirmIntegrationConfigResponse
 */
async function confirmIntegrationConfig(request: ConfirmIntegrationConfigRequest): ConfirmIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return confirmIntegrationConfigWithOptions(request, headers, runtime);
}

model CreateEscalationPlanRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='6b404f14-77d1-4b53-a1a1-30a58bREQUEST'),
  escalationPlanDescription?: string(name='escalationPlanDescription', description='This parameter is required.', example='desc2322424'),
  escalationPlanName?: string(name='escalationPlanName', description='This parameter is required.', example='name123'),
  escalationPlanRules?: [ 
    {
      escalationPlanConditions?: [ 
        {
          effection?: string(name='effection', description='This parameter is required.', example='LOW'),
          level?: string(name='level', description='This parameter is required.', example='P1'),
        }
      ](name='escalationPlanConditions', description='This parameter is required.'),
      escalationPlanStrategies?: [ 
        {
          enableWebhook?: boolean(name='enableWebhook', description='This parameter is required.', example='true'),
          escalationPlanType?: string(name='escalationPlanType'),
          noticeChannels?: [ string ](name='noticeChannels', description='This parameter is required.'),
          noticeObjects?: [ long ](name='noticeObjects', description='This parameter is required.'),
          noticeRoleList?: [ long ](name='noticeRoleList'),
          noticeTime?: string(name='noticeTime', description='This parameter is required.', example='40'),
          serviceGroupIds?: [ long ](name='serviceGroupIds'),
        }
      ](name='escalationPlanStrategies', description='This parameter is required.'),
      escalationPlanType?: string(name='escalationPlanType', example='UN_FINISH'),
    }
  ](name='escalationPlanRules', description='This parameter is required.'),
  escalationPlanScopeObjects?: [ 
    {
      scope?: string(name='scope', example='SERVICE'),
      scopeObjectId?: long(name='scopeObjectId', description='This parameter is required.', example='23433'),
    }
  ](name='escalationPlanScopeObjects', description='This parameter is required.'),
  isGlobal?: boolean(name='isGlobal'),
}

model CreateEscalationPlanResponseBody = {
  data?: {
    escalationPlanId?: long(name='escalationPlanId', example='234532'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC21925D'),
}

model CreateEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 创建升级计划
 *
 * @param request CreateEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEscalationPlanResponse
 */
async function createEscalationPlanWithOptions(request: CreateEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanDescription)) {
    body['escalationPlanDescription'] = request.escalationPlanDescription;
  }
  if (!Util.isUnset(request.escalationPlanName)) {
    body['escalationPlanName'] = request.escalationPlanName;
  }
  if (!Util.isUnset(request.escalationPlanRules)) {
    body['escalationPlanRules'] = request.escalationPlanRules;
  }
  if (!Util.isUnset(request.escalationPlanScopeObjects)) {
    body['escalationPlanScopeObjects'] = request.escalationPlanScopeObjects;
  }
  if (!Util.isUnset(request.isGlobal)) {
    body['isGlobal'] = request.isGlobal;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建升级计划
 *
 * @param request CreateEscalationPlanRequest
 * @return CreateEscalationPlanResponse
 */
async function createEscalationPlan(request: CreateEscalationPlanRequest): CreateEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEscalationPlanWithOptions(request, headers, runtime);
}

model CreateIncidentRequest {
  assignUserId?: long(name='assignUserId', example='12312'),
  channels?: [ string ](name='channels'),
  clientToken?: string(name='clientToken', example='2b63cdef-7ac3-4892-a76d-0f3389ef729f'),
  effect?: string(name='effect', example='LOW'),
  incidentDescription?: string(name='incidentDescription'),
  incidentLevel?: string(name='incidentLevel', example='P1'),
  incidentTitle?: string(name='incidentTitle'),
  relatedServiceId?: long(name='relatedServiceId', example='12312'),
  serviceGroupId?: long(name='serviceGroupId', description='12000', example='12312'),
}

model CreateIncidentResponseBody = {
  data?: {
    incidentId?: long(name='incidentId'),
  }(name='data', description='Id of the request'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model CreateIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIncidentResponseBody(name='body'),
}

/**
 * @summary 手动创建事件
 *
 * @param request CreateIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIncidentResponse
 */
async function createIncidentWithOptions(request: CreateIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignUserId)) {
    body['assignUserId'] = request.assignUserId;
  }
  if (!Util.isUnset(request.channels)) {
    body['channels'] = request.channels;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.effect)) {
    body['effect'] = request.effect;
  }
  if (!Util.isUnset(request.incidentDescription)) {
    body['incidentDescription'] = request.incidentDescription;
  }
  if (!Util.isUnset(request.incidentLevel)) {
    body['incidentLevel'] = request.incidentLevel;
  }
  if (!Util.isUnset(request.incidentTitle)) {
    body['incidentTitle'] = request.incidentTitle;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/manualSave`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手动创建事件
 *
 * @param request CreateIncidentRequest
 * @return CreateIncidentResponse
 */
async function createIncident(request: CreateIncidentRequest): CreateIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createIncidentWithOptions(request, headers, runtime);
}

model CreateIncidentSubtotalRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  description?: string(name='description', example='描述'),
  incidentId?: long(name='incidentId', description='This parameter is required.', example='12312'),
}

model CreateIncidentSubtotalResponseBody = {
  data?: {
    subtotalId?: long(name='subtotalId', example='123'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model CreateIncidentSubtotalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIncidentSubtotalResponseBody(name='body'),
}

/**
 * @summary 新增事件小计
 *
 * @param request CreateIncidentSubtotalRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIncidentSubtotalResponse
 */
async function createIncidentSubtotalWithOptions(request: CreateIncidentSubtotalRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateIncidentSubtotalResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateIncidentSubtotal',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/save/subtotal`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增事件小计
 *
 * @param request CreateIncidentSubtotalRequest
 * @return CreateIncidentSubtotalResponse
 */
async function createIncidentSubtotal(request: CreateIncidentSubtotalRequest): CreateIncidentSubtotalResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createIncidentSubtotalWithOptions(request, headers, runtime);
}

model CreateIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  monitorSourceId?: long(name='monitorSourceId', example='1'),
}

model CreateIntegrationConfigResponseBody = {
  data?: {
    integrationConfigId?: long(name='integrationConfigId', example='101'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model CreateIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 创建集成配置
 *
 * @param request CreateIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateIntegrationConfigResponse
 */
async function createIntegrationConfigWithOptions(request: CreateIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.monitorSourceId)) {
    body['monitorSourceId'] = request.monitorSourceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建集成配置
 *
 * @param request CreateIntegrationConfigRequest
 * @return CreateIntegrationConfigResponse
 */
async function createIntegrationConfig(request: CreateIntegrationConfigRequest): CreateIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createIntegrationConfigWithOptions(request, headers, runtime);
}

model CreateProblemRequest {
  affectServiceIds?: [ long ](name='affectServiceIds'),
  clientToken?: string(name='clientToken', example='E789D869-DB13-4913-BAA8-A1F56F94B94D'),
  discoverTime?: string(name='discoverTime', example='2020-10-02 00:00:00'),
  incidentId?: long(name='incidentId', example='123221'),
  mainHandlerId?: long(name='mainHandlerId', example='32121'),
  preliminaryReason?: string(name='preliminaryReason', example='初步原因'),
  problemLevel?: string(name='problemLevel', example='P2'),
  problemName?: string(name='problemName', example='故障A'),
  problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_NOTIFY'),
  problemStatus?: string(name='problemStatus', example='HANDLING'),
  progressSummary?: string(name='progressSummary', example='进展摘要'),
  progressSummaryRichTextId?: long(name='progressSummaryRichTextId', example='343'),
  recoveryTime?: string(name='recoveryTime', example='2020-10-02 00:00:00'),
  relatedServiceId?: long(name='relatedServiceId', example='123122'),
  serviceGroupIds?: [ long ](name='serviceGroupIds'),
}

model CreateProblemResponseBody = {
  data?: {
    problemId?: long(name='problemId', example='321331'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='E789D869-DB13-4933-BAA8-A1F56F94B94D'),
}

model CreateProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemResponseBody(name='body'),
}

/**
 * @summary 故障升级
 *
 * @param request CreateProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemResponse
 */
async function createProblemWithOptions(request: CreateProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.affectServiceIds)) {
    body['affectServiceIds'] = request.affectServiceIds;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.discoverTime)) {
    body['discoverTime'] = request.discoverTime;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }
  if (!Util.isUnset(request.mainHandlerId)) {
    body['mainHandlerId'] = request.mainHandlerId;
  }
  if (!Util.isUnset(request.preliminaryReason)) {
    body['preliminaryReason'] = request.preliminaryReason;
  }
  if (!Util.isUnset(request.problemLevel)) {
    body['problemLevel'] = request.problemLevel;
  }
  if (!Util.isUnset(request.problemName)) {
    body['problemName'] = request.problemName;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }
  if (!Util.isUnset(request.problemStatus)) {
    body['problemStatus'] = request.problemStatus;
  }
  if (!Util.isUnset(request.progressSummary)) {
    body['progressSummary'] = request.progressSummary;
  }
  if (!Util.isUnset(request.progressSummaryRichTextId)) {
    body['progressSummaryRichTextId'] = request.progressSummaryRichTextId;
  }
  if (!Util.isUnset(request.recoveryTime)) {
    body['recoveryTime'] = request.recoveryTime;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.serviceGroupIds)) {
    body['serviceGroupIds'] = request.serviceGroupIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/upgrade`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障升级
 *
 * @param request CreateProblemRequest
 * @return CreateProblemResponse
 */
async function createProblem(request: CreateProblemRequest): CreateProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemWithOptions(request, headers, runtime);
}

model CreateProblemEffectionServiceRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='e0b6735e-1a04-4d6b-a625-d2350612492c'),
  description?: string(name='description', example='erdwcdc'),
  level?: string(name='level', example='P2'),
  pictureUrl?: [ string ](name='pictureUrl'),
  problemId?: long(name='problemId', description='This parameter is required.', example='150000000'),
  serviceId?: long(name='serviceId', example='170000000'),
  status?: string(name='status', example='UN_RECOVERED'),
}

model CreateProblemEffectionServiceResponseBody = {
  data?: {
    effectionServiceId?: long(name='effectionServiceId', example='6442430'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model CreateProblemEffectionServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemEffectionServiceResponseBody(name='body'),
}

/**
 * @summary 创建影响服务
 *
 * @param request CreateProblemEffectionServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemEffectionServiceResponse
 */
async function createProblemEffectionServiceWithOptions(request: CreateProblemEffectionServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemEffectionServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.level)) {
    body['level'] = request.level;
  }
  if (!Util.isUnset(request.pictureUrl)) {
    body['pictureUrl'] = request.pictureUrl;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblemEffectionService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/effectionService/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建影响服务
 *
 * @param request CreateProblemEffectionServiceRequest
 * @return CreateProblemEffectionServiceResponse
 */
async function createProblemEffectionService(request: CreateProblemEffectionServiceRequest): CreateProblemEffectionServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemEffectionServiceWithOptions(request, headers, runtime);
}

model CreateProblemMeasureRequest {
  checkStandard?: string(name='checkStandard', example='标准'),
  checkUserId?: long(name='checkUserId', example='123'),
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  content?: string(name='content', example='措施内容'),
  directorId?: long(name='directorId', example='123'),
  planFinishTime?: string(name='planFinishTime', example='2020-01-23 00:00:00'),
  problemId?: long(name='problemId', description='This parameter is required.', example='23'),
  stalkerId?: long(name='stalkerId', example='123'),
  status?: string(name='status', example='IMPROVED'),
  type?: int32(name='type', example='1'),
}

model CreateProblemMeasureResponseBody = {
  data?: {
    measureId?: long(name='measureId', example='1231'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model CreateProblemMeasureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemMeasureResponseBody(name='body'),
}

/**
 * @summary 改进措施新增
 *
 * @param request CreateProblemMeasureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemMeasureResponse
 */
async function createProblemMeasureWithOptions(request: CreateProblemMeasureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemMeasureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.checkStandard)) {
    body['checkStandard'] = request.checkStandard;
  }
  if (!Util.isUnset(request.checkUserId)) {
    body['checkUserId'] = request.checkUserId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.directorId)) {
    body['directorId'] = request.directorId;
  }
  if (!Util.isUnset(request.planFinishTime)) {
    body['planFinishTime'] = request.planFinishTime;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.stalkerId)) {
    body['stalkerId'] = request.stalkerId;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblemMeasure',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/improvement/measure/save`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改进措施新增
 *
 * @param request CreateProblemMeasureRequest
 * @return CreateProblemMeasureResponse
 */
async function createProblemMeasure(request: CreateProblemMeasureRequest): CreateProblemMeasureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemMeasureWithOptions(request, headers, runtime);
}

model CreateProblemSubtotalRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3814'),
  description?: string(name='description'),
  problemId?: long(name='problemId', description='This parameter is required.', example='1231'),
}

model CreateProblemSubtotalResponseBody = {
  data?: {
    subtotalId?: long(name='subtotalId', example='123'),
  }(name='data', description='object'),
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd381A'),
}

model CreateProblemSubtotalResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemSubtotalResponseBody(name='body'),
}

/**
 * @summary 故障新增备注小计
 *
 * @param request CreateProblemSubtotalRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemSubtotalResponse
 */
async function createProblemSubtotalWithOptions(request: CreateProblemSubtotalRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemSubtotalResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblemSubtotal',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/save/subtotal`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障新增备注小计
 *
 * @param request CreateProblemSubtotalRequest
 * @return CreateProblemSubtotalResponse
 */
async function createProblemSubtotal(request: CreateProblemSubtotalRequest): CreateProblemSubtotalResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemSubtotalWithOptions(request, headers, runtime);
}

model CreateProblemTimelineRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378FTOKENA11'),
  content?: string(name='content', example='test123'),
  keyNode?: string(name='keyNode', example='NodeTest'),
  problemId?: long(name='problemId', description='This parameter is required.', example='102'),
  time?: string(name='time', example='2021-06-06 12:11:22'),
}

model CreateProblemTimelineResponseBody = {
  data?: {
    problemTimelineId?: long(name='problemTimelineId', example='102'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model CreateProblemTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemTimelineResponseBody(name='body'),
}

/**
 * @summary 创建故障时间线节点
 *
 * @param request CreateProblemTimelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemTimelineResponse
 */
async function createProblemTimelineWithOptions(request: CreateProblemTimelineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemTimelineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.keyNode)) {
    body['keyNode'] = request.keyNode;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.time)) {
    body['time'] = request.time;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblemTimeline',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/timeline/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建故障时间线节点
 *
 * @param request CreateProblemTimelineRequest
 * @return CreateProblemTimelineResponse
 */
async function createProblemTimeline(request: CreateProblemTimelineRequest): CreateProblemTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemTimelineWithOptions(request, headers, runtime);
}

model CreateProblemTimelinesRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='e0b6735e-1a04-4d6b-a625-d2350612492c'),
  problemId?: long(name='problemId', description='This parameter is required.', example='423'),
  timelineNodes?: string(name='timelineNodes', example='2018-01-01 18:01，谁做了什么事情\\n2018-01-01 18:01，谁做了什么事情\\n2018-01-01 18:01，谁做了什么事情'),
}

model CreateProblemTimelinesResponseBody = {
  data?: {
    problemTimelineIds?: [ long ](name='problemTimelineIds'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model CreateProblemTimelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProblemTimelinesResponseBody(name='body'),
}

/**
 * @summary 批量创建故障时间线节点
 *
 * @param request CreateProblemTimelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProblemTimelinesResponse
 */
async function createProblemTimelinesWithOptions(request: CreateProblemTimelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProblemTimelinesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.timelineNodes)) {
    body['timelineNodes'] = request.timelineNodes;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProblemTimelines',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/timeline/batchCreate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量创建故障时间线节点
 *
 * @param request CreateProblemTimelinesRequest
 * @return CreateProblemTimelinesResponse
 */
async function createProblemTimelines(request: CreateProblemTimelinesRequest): CreateProblemTimelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProblemTimelinesWithOptions(request, headers, runtime);
}

model CreateRichTextRequest {
  instanceId?: long(name='instanceId', example='12221'),
  instanceType?: string(name='instanceType', example='INCIDENT 事件 ALERT告警 PROBLEM故障'),
  richText?: string(name='richText', example='这是一个富文本'),
}

model CreateRichTextResponseBody = {
  data?: {
    instanceId?: long(name='instanceId', example='1231'),
    instanceType?: long(name='instanceType', example='0 事件 1告警 2 故障'),
    richText?: string(name='richText', example='这是一个富文本'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model CreateRichTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRichTextResponseBody(name='body'),
}

/**
 * @summary 创建富文本
 *
 * @param request CreateRichTextRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRichTextResponse
 */
async function createRichTextWithOptions(request: CreateRichTextRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateRichTextResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.richText)) {
    body['richText'] = request.richText;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRichText',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/rich/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建富文本
 *
 * @param request CreateRichTextRequest
 * @return CreateRichTextResponse
 */
async function createRichText(request: CreateRichTextRequest): CreateRichTextResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createRichTextWithOptions(request, headers, runtime);
}

model CreateRouteRuleRequest {
  assignObjectId?: long(name='assignObjectId', description='This parameter is required.', example='65'),
  assignObjectType?: string(name='assignObjectType', description='This parameter is required.', example='SERVICEGROUP'),
  childRuleRelation?: string(name='childRuleRelation', description='This parameter is required.', example='AND'),
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  convergenceFields?: [ string ](name='convergenceFields'),
  convergenceType?: int32(name='convergenceType'),
  coverageProblemLevels?: [ string ](name='coverageProblemLevels'),
  effection?: string(name='effection', description='This parameter is required.', example='LOW'),
  enableStatus?: string(name='enableStatus', example='false'),
  incidentLevel?: string(name='incidentLevel', description='This parameter is required.', example='P1'),
  matchCount?: int32(name='matchCount', description='This parameter is required.', example='3'),
  notifyChannels?: [ string ](name='notifyChannels', description='This parameter is required.'),
  problemEffectionServices?: [ long ](name='problemEffectionServices'),
  problemLevelGroup?: map[string]ProblemLevelGroupValue(name='problemLevelGroup'),
  relatedServiceId?: long(name='relatedServiceId', description='This parameter is required.', example='100'),
  routeChildRules?: [ 
    {
      childConditionRelation?: long(name='childConditionRelation', example='0'),
      conditions?: [ 
        {
          key?: string(name='key', description='This parameter is required.', example='payload.summary'),
          operationSymbol?: string(name='operationSymbol', description='This parameter is required.', example='equals'),
          value?: string(name='value', description='This parameter is required.', example='123'),
        }
      ](name='conditions', description='This parameter is required.'),
      monitorSourceId?: long(name='monitorSourceId', description='This parameter is required.', example='1'),
      problemLevel?: string(name='problemLevel'),
    }
  ](name='routeChildRules', description='This parameter is required.'),
  routeType?: string(name='routeType', description='This parameter is required.', example='INCIDENT'),
  ruleName?: string(name='ruleName', description='This parameter is required.', example='这是一个规则'),
  timeWindow?: long(name='timeWindow', description='This parameter is required.', example='2'),
  timeWindowUnit?: string(name='timeWindowUnit', description='This parameter is required.', example='MINUTE'),
}

model CreateRouteRuleResponseBody = {
  data?: {
    routeRuleId?: long(name='routeRuleId', example='1000'),
  }(name='data', example='65'),
  requestId?: string(name='requestId', example='请求ID'),
}

model CreateRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRouteRuleResponseBody(name='body'),
}

/**
 * @summary 创建流转规则
 *
 * @param request CreateRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRouteRuleResponse
 */
async function createRouteRuleWithOptions(request: CreateRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignObjectId)) {
    body['assignObjectId'] = request.assignObjectId;
  }
  if (!Util.isUnset(request.assignObjectType)) {
    body['assignObjectType'] = request.assignObjectType;
  }
  if (!Util.isUnset(request.childRuleRelation)) {
    body['childRuleRelation'] = request.childRuleRelation;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.convergenceFields)) {
    body['convergenceFields'] = request.convergenceFields;
  }
  if (!Util.isUnset(request.convergenceType)) {
    body['convergenceType'] = request.convergenceType;
  }
  if (!Util.isUnset(request.coverageProblemLevels)) {
    body['coverageProblemLevels'] = request.coverageProblemLevels;
  }
  if (!Util.isUnset(request.effection)) {
    body['effection'] = request.effection;
  }
  if (!Util.isUnset(request.enableStatus)) {
    body['enableStatus'] = request.enableStatus;
  }
  if (!Util.isUnset(request.incidentLevel)) {
    body['incidentLevel'] = request.incidentLevel;
  }
  if (!Util.isUnset(request.matchCount)) {
    body['matchCount'] = request.matchCount;
  }
  if (!Util.isUnset(request.notifyChannels)) {
    body['notifyChannels'] = request.notifyChannels;
  }
  if (!Util.isUnset(request.problemEffectionServices)) {
    body['problemEffectionServices'] = request.problemEffectionServices;
  }
  if (!Util.isUnset(request.problemLevelGroup)) {
    body['problemLevelGroup'] = request.problemLevelGroup;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.routeChildRules)) {
    body['routeChildRules'] = request.routeChildRules;
  }
  if (!Util.isUnset(request.routeType)) {
    body['routeType'] = request.routeType;
  }
  if (!Util.isUnset(request.ruleName)) {
    body['ruleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.timeWindow)) {
    body['timeWindow'] = request.timeWindow;
  }
  if (!Util.isUnset(request.timeWindowUnit)) {
    body['timeWindowUnit'] = request.timeWindowUnit;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/save`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建流转规则
 *
 * @param request CreateRouteRuleRequest
 * @return CreateRouteRuleResponse
 */
async function createRouteRule(request: CreateRouteRuleRequest): CreateRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createRouteRuleWithOptions(request, headers, runtime);
}

model CreateServiceRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  escalationPlanId?: long(name='escalationPlanId'),
  serviceDescription?: string(name='serviceDescription', example='服务描述'),
  serviceGroupIdList?: [ long ](name='serviceGroupIdList'),
  serviceName?: string(name='serviceName', description='This parameter is required.', example='服务名称'),
}

model CreateServiceResponseBody = {
  data?: {
    serviceId?: long(name='serviceId', example='1'),
  }(name='data', example='1'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model CreateServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceResponseBody(name='body'),
}

/**
 * @summary 创建服务
 *
 * @param request CreateServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceResponse
 */
async function createServiceWithOptions(request: CreateServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }
  if (!Util.isUnset(request.serviceDescription)) {
    body['serviceDescription'] = request.serviceDescription;
  }
  if (!Util.isUnset(request.serviceGroupIdList)) {
    body['serviceGroupIdList'] = request.serviceGroupIdList;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['serviceName'] = request.serviceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/save`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建服务
 *
 * @param request CreateServiceRequest
 * @return CreateServiceResponse
 */
async function createService(request: CreateServiceRequest): CreateServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceWithOptions(request, headers, runtime);
}

model CreateServiceGroupRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  enableWebhook?: string(name='enableWebhook', description='This parameter is required.', example='ENABLE'),
  monitorSourceTemplates?: [ 
    {
      monitorSourceId?: long(name='monitorSourceId', example='111'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
      templateContent?: string(name='templateContent', example='xx'),
      templateId?: long(name='templateId', example='111'),
    }
  ](name='monitorSourceTemplates'),
  serviceGroupDescription?: string(name='serviceGroupDescription', example='服务描述'),
  serviceGroupName?: string(name='serviceGroupName', description='This parameter is required.', example='冲上云霄'),
  userIds?: [ long ](name='userIds', description='This parameter is required.'),
  webhookLink?: string(name='webhookLink', description='webhooklink

This parameter is required.', example='WWWWWWW'),
  webhookType?: string(name='webhookType', description='This parameter is required.', example='WEIXIN_GROUP'),
}

model CreateServiceGroupResponseBody = {
  data?: {
    serviceGroupId?: long(name='serviceGroupId', example='1000'),
  }(name='data', example='1'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model CreateServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceGroupResponseBody(name='body'),
}

/**
 * @summary 创建服务组
 *
 * @param request CreateServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceGroupResponse
 */
async function createServiceGroupWithOptions(request: CreateServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enableWebhook)) {
    body['enableWebhook'] = request.enableWebhook;
  }
  if (!Util.isUnset(request.monitorSourceTemplates)) {
    body['monitorSourceTemplates'] = request.monitorSourceTemplates;
  }
  if (!Util.isUnset(request.serviceGroupDescription)) {
    body['serviceGroupDescription'] = request.serviceGroupDescription;
  }
  if (!Util.isUnset(request.serviceGroupName)) {
    body['serviceGroupName'] = request.serviceGroupName;
  }
  if (!Util.isUnset(request.userIds)) {
    body['userIds'] = request.userIds;
  }
  if (!Util.isUnset(request.webhookLink)) {
    body['webhookLink'] = request.webhookLink;
  }
  if (!Util.isUnset(request.webhookType)) {
    body['webhookType'] = request.webhookType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/insert`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建服务组
 *
 * @param request CreateServiceGroupRequest
 * @return CreateServiceGroupResponse
 */
async function createServiceGroup(request: CreateServiceGroupRequest): CreateServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceGroupWithOptions(request, headers, runtime);
}

model CreateServiceGroupSchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  fastScheduling?: {
    dutyPlan?: string(name='dutyPlan', example='FAST_CHOICE'),
    schedulingUsers?: [ 
      {
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: long(name='schedulingOrder', example='1'),
        schedulingUserId?: long(name='schedulingUserId', example='6666'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
      }
    ](name='schedulingUsers'),
    singleDuration?: int32(name='singleDuration', example='12'),
    singleDurationUnit?: string(name='singleDurationUnit', example='DAY'),
  }(name='fastScheduling', example='12'),
  fineScheduling?: {
    period?: int32(name='period', example='1'),
    periodUnit?: string(name='periodUnit', example='DAY'),
    schedulingFineShifts?: [ 
      {
        cycleOrder?: int32(name='cycleOrder', example='1'),
        schedulingEndTime?: string(name='schedulingEndTime', example='2020-10-13'),
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: int32(name='schedulingOrder', example='1'),
        schedulingStartTime?: string(name='schedulingStartTime', example='2020-08-13'),
        schedulingUserId?: long(name='schedulingUserId', example='11'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
        shiftName?: string(name='shiftName', example='早班'),
        skipOneDay?: boolean(name='skipOneDay', example='fasle'),
      }
    ](name='schedulingFineShifts'),
    schedulingTemplateFineShifts?: [ 
      {
        schedulingEndTime?: string(name='schedulingEndTime', example='2021-10-01 08:00:00'),
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: long(name='schedulingOrder', example='1'),
        schedulingStartTime?: string(name='schedulingStartTime', example='2021-09-01 08:00:00'),
        schedulingUserId?: long(name='schedulingUserId', example='1'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
        schedulingUserName?: string(name='schedulingUserName'),
        skipOneDay?: boolean(name='skipOneDay', example='false'),
      }
    ](name='schedulingTemplateFineShifts'),
    shiftType?: string(name='shiftType', example='MORNING_NIGHT'),
  }(name='fineScheduling'),
  schedulingWay?: string(name='schedulingWay', description='This parameter is required.', example='FAST'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='1000'),
}

model CreateServiceGroupSchedulingResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxxxxx'),
}

model CreateServiceGroupSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceGroupSchedulingResponseBody(name='body'),
}

/**
 * @summary 新增服务组排班
 *
 * @param request CreateServiceGroupSchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceGroupSchedulingResponse
 */
async function createServiceGroupSchedulingWithOptions(request: CreateServiceGroupSchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceGroupSchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.fastScheduling)) {
    body['fastScheduling'] = request.fastScheduling;
  }
  if (!Util.isUnset(request.fineScheduling)) {
    body['fineScheduling'] = request.fineScheduling;
  }
  if (!Util.isUnset(request.schedulingWay)) {
    body['schedulingWay'] = request.schedulingWay;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceGroupScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/save`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增服务组排班
 *
 * @param request CreateServiceGroupSchedulingRequest
 * @return CreateServiceGroupSchedulingResponse
 */
async function createServiceGroupScheduling(request: CreateServiceGroupSchedulingRequest): CreateServiceGroupSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceGroupSchedulingWithOptions(request, headers, runtime);
}

model CreateSubscriptionRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378FTOKENA11'),
  endTime?: string(name='endTime', example='2021-11-03 10:10:10'),
  expiredType?: long(name='expiredType', description='This parameter is required.', example='LONG_TERM'),
  notifyObjectList?: [ 
    {
      notifyObjectId?: long(name='notifyObjectId', description='This parameter is required.', example='2'),
    }
  ](name='notifyObjectList', description='This parameter is required.'),
  notifyObjectType?: long(name='notifyObjectType', description='This parameter is required.', example='USER'),
  notifyStrategyList?: [ 
    {
      channels?: string(name='channels', description='This parameter is required.', example='SMS,PHONE'),
      instanceType?: long(name='instanceType', description='This parameter is required.', example='INCIDENT'),
      periodChannel?: {
        nonWorkday?: string(name='nonWorkday', example='SMS,PHONE'),
        workday?: string(name='workday', example='SMS,PHONE'),
      }(name='periodChannel'),
      strategies?: [ 
        {
          conditions?: [ 
            {
              action?: string(name='action', example='INCIDENT_TRIGGER'),
              effection?: string(name='effection', example='HIGH'),
              level?: string(name='level', example='P1'),
              problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_UPDATE'),
            }
          ](name='conditions'),
        }
      ](name='strategies', description='This parameter is required.'),
    }
  ](name='notifyStrategyList', description='This parameter is required.'),
  period?: string(name='period', example='1个月'),
  scope?: long(name='scope', description='This parameter is required.', example='SERVICE'),
  scopeObjectList?: [ 
    {
      scopeObjectId?: long(name='scopeObjectId', description='This parameter is required.', example='1'),
    }
  ](name='scopeObjectList', description='This parameter is required.'),
  startTime?: string(name='startTime', example='2021-02-03 10:10:10'),
  subscriptionTitle?: string(name='subscriptionTitle', description='This parameter is required.', example='testSubscription'),
}

model CreateSubscriptionResponseBody = {
  data?: {
    subscriptionId?: long(name='subscriptionId', example='101'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='request id', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model CreateSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSubscriptionResponseBody(name='body'),
}

/**
 * @summary 创建通知订阅
 *
 * @param request CreateSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSubscriptionResponse
 */
async function createSubscriptionWithOptions(request: CreateSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.expiredType)) {
    body['expiredType'] = request.expiredType;
  }
  if (!Util.isUnset(request.notifyObjectList)) {
    body['notifyObjectList'] = request.notifyObjectList;
  }
  if (!Util.isUnset(request.notifyObjectType)) {
    body['notifyObjectType'] = request.notifyObjectType;
  }
  if (!Util.isUnset(request.notifyStrategyList)) {
    body['notifyStrategyList'] = request.notifyStrategyList;
  }
  if (!Util.isUnset(request.period)) {
    body['period'] = request.period;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.scopeObjectList)) {
    body['scopeObjectList'] = request.scopeObjectList;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.subscriptionTitle)) {
    body['subscriptionTitle'] = request.subscriptionTitle;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建通知订阅
 *
 * @param request CreateSubscriptionRequest
 * @return CreateSubscriptionResponse
 */
async function createSubscription(request: CreateSubscriptionRequest): CreateSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSubscriptionWithOptions(request, headers, runtime);
}

model CreateTenantApplicationRequest {
  channel?: string(name='channel', description='This parameter is required.', example='DINGDING'),
  clientToken?: string(name='clientToken', description='This parameter is required.', example='7C56D225-7C34-40BB-9624-C8BA449260E6'),
}

model CreateTenantApplicationResponseBody = {
  data?: {
    openUrl?: string(name='openUrl', example='http://xxxx'),
    progress?: string(name='progress', example='OPENED 已开通 OPENING 开通中'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the req', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model CreateTenantApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTenantApplicationResponseBody(name='body'),
}

/**
 * @summary 云钉协同创建移动应用
 *
 * @param request CreateTenantApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTenantApplicationResponse
 */
async function createTenantApplicationWithOptions(request: CreateTenantApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTenantApplicationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.channel)) {
    body['channel'] = request.channel;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTenantApplication',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/mobileApp/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 云钉协同创建移动应用
 *
 * @param request CreateTenantApplicationRequest
 * @return CreateTenantApplicationResponse
 */
async function createTenantApplication(request: CreateTenantApplicationRequest): CreateTenantApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTenantApplicationWithOptions(request, headers, runtime);
}

model CreateUserRequest {
  clientToken?: string(name='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  email?: string(name='email', example='5678@qq.com'),
  phone?: string(name='phone', example='188898989892'),
  ramId?: long(name='ramId', example='4787654378343'),
  roleIdList?: [ long ](name='roleIdList'),
  username?: string(name='username'),
}

model CreateUserResponseBody = {
  data?: {
    userId?: long(name='userId', example='1'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model CreateUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserResponseBody(name='body'),
}

/**
 * @summary 创建用户
 *
 * @param request CreateUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserResponse
 */
async function createUserWithOptions(request: CreateUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.email)) {
    body['email'] = request.email;
  }
  if (!Util.isUnset(request.phone)) {
    body['phone'] = request.phone;
  }
  if (!Util.isUnset(request.ramId)) {
    body['ramId'] = request.ramId;
  }
  if (!Util.isUnset(request.roleIdList)) {
    body['roleIdList'] = request.roleIdList;
  }
  if (!Util.isUnset(request.username)) {
    body['username'] = request.username;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建用户
 *
 * @param request CreateUserRequest
 * @return CreateUserResponse
 */
async function createUser(request: CreateUserRequest): CreateUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createUserWithOptions(request, headers, runtime);
}

model DeleteEscalationPlanRequest {
  clientToken?: string(name='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='234534'),
}

model DeleteEscalationPlanResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC21925D'),
}

model DeleteEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 删除升级计划
 *
 * @param request DeleteEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEscalationPlanResponse
 */
async function deleteEscalationPlanWithOptions(request: DeleteEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除升级计划
 *
 * @param request DeleteEscalationPlanRequest
 * @return DeleteEscalationPlanResponse
 */
async function deleteEscalationPlan(request: DeleteEscalationPlanRequest): DeleteEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEscalationPlanWithOptions(request, headers, runtime);
}

model DeleteIncidentRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  incidentId?: long(name='incidentId', example='12321'),
}

model DeleteIncidentResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model DeleteIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIncidentResponseBody(name='body'),
}

/**
 * @summary 事件删除
 *
 * @param request DeleteIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIncidentResponse
 */
async function deleteIncidentWithOptions(request: DeleteIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件删除
 *
 * @param request DeleteIncidentRequest
 * @return DeleteIncidentResponse
 */
async function deleteIncident(request: DeleteIncidentRequest): DeleteIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteIncidentWithOptions(request, headers, runtime);
}

model DeleteIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='100'),
}

model DeleteIntegrationConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model DeleteIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 删除集成配置
 *
 * @param request DeleteIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIntegrationConfigResponse
 */
async function deleteIntegrationConfigWithOptions(request: DeleteIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除集成配置
 *
 * @param request DeleteIntegrationConfigRequest
 * @return DeleteIntegrationConfigResponse
 */
async function deleteIntegrationConfig(request: DeleteIntegrationConfigRequest): DeleteIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteIntegrationConfigWithOptions(request, headers, runtime);
}

model DeleteProblemRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  problemId?: long(name='problemId', example='1231'),
}

model DeleteProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model DeleteProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProblemResponseBody(name='body'),
}

/**
 * @summary 故障刪除
 *
 * @param request DeleteProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProblemResponse
 */
async function deleteProblemWithOptions(request: DeleteProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障刪除
 *
 * @param request DeleteProblemRequest
 * @return DeleteProblemResponse
 */
async function deleteProblem(request: DeleteProblemRequest): DeleteProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProblemWithOptions(request, headers, runtime);
}

model DeleteProblemEffectionServiceRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='e0b6735e-1a04-4d6b-a625-d2350612492c'),
  effectionServiceId?: long(name='effectionServiceId', example='567'),
  problemId?: long(name='problemId', example='876'),
}

model DeleteProblemEffectionServiceResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='e0b6735e-1a04-4d6b-a625-d2350612492c'),
}

model DeleteProblemEffectionServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProblemEffectionServiceResponseBody(name='body'),
}

/**
 * @summary 删除故障影响服务
 *
 * @param request DeleteProblemEffectionServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProblemEffectionServiceResponse
 */
async function deleteProblemEffectionServiceWithOptions(request: DeleteProblemEffectionServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProblemEffectionServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.effectionServiceId)) {
    body['effectionServiceId'] = request.effectionServiceId;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProblemEffectionService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/effectionService/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除故障影响服务
 *
 * @param request DeleteProblemEffectionServiceRequest
 * @return DeleteProblemEffectionServiceResponse
 */
async function deleteProblemEffectionService(request: DeleteProblemEffectionServiceRequest): DeleteProblemEffectionServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProblemEffectionServiceWithOptions(request, headers, runtime);
}

model DeleteProblemMeasureRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  measureId?: long(name='measureId', example='1213'),
  problemId?: string(name='problemId', example='2131'),
}

model DeleteProblemMeasureResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model DeleteProblemMeasureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProblemMeasureResponseBody(name='body'),
}

/**
 * @summary 改进措施删除
 *
 * @param request DeleteProblemMeasureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProblemMeasureResponse
 */
async function deleteProblemMeasureWithOptions(request: DeleteProblemMeasureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProblemMeasureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.measureId)) {
    body['measureId'] = request.measureId;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProblemMeasure',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/improvement/measure/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改进措施删除
 *
 * @param request DeleteProblemMeasureRequest
 * @return DeleteProblemMeasureResponse
 */
async function deleteProblemMeasure(request: DeleteProblemMeasureRequest): DeleteProblemMeasureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProblemMeasureWithOptions(request, headers, runtime);
}

model DeleteProblemTimelineRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378FTOKENA11'),
  problemId?: long(name='problemId', example='102'),
  problemTimelineId?: long(name='problemTimelineId', example='11'),
}

model DeleteProblemTimelineResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model DeleteProblemTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProblemTimelineResponseBody(name='body'),
}

/**
 * @summary 删除影响服务
 *
 * @param request DeleteProblemTimelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProblemTimelineResponse
 */
async function deleteProblemTimelineWithOptions(request: DeleteProblemTimelineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProblemTimelineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemTimelineId)) {
    body['problemTimelineId'] = request.problemTimelineId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProblemTimeline',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/timeline/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除影响服务
 *
 * @param request DeleteProblemTimelineRequest
 * @return DeleteProblemTimelineResponse
 */
async function deleteProblemTimeline(request: DeleteProblemTimelineRequest): DeleteProblemTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProblemTimelineWithOptions(request, headers, runtime);
}

model DeleteRouteRuleRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  routeRuleId?: long(name='routeRuleId', description='This parameter is required.', example='10000'),
}

model DeleteRouteRuleResponseBody = {
  requestId?: long(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model DeleteRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRouteRuleResponseBody(name='body'),
}

/**
 * @summary 删除流转规则
 *
 * @param request DeleteRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRouteRuleResponse
 */
async function deleteRouteRuleWithOptions(request: DeleteRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除流转规则
 *
 * @param request DeleteRouteRuleRequest
 * @return DeleteRouteRuleResponse
 */
async function deleteRouteRule(request: DeleteRouteRuleRequest): DeleteRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRouteRuleWithOptions(request, headers, runtime);
}

model DeleteServiceRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceId?: long(name='serviceId', example='10002000'),
}

model DeleteServiceResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model DeleteServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServiceResponseBody(name='body'),
}

/**
 * @summary 删除服务
 *
 * @param request DeleteServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServiceResponse
 */
async function deleteServiceWithOptions(request: DeleteServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除服务
 *
 * @param request DeleteServiceRequest
 * @return DeleteServiceResponse
 */
async function deleteService(request: DeleteServiceRequest): DeleteServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteServiceWithOptions(request, headers, runtime);
}

model DeleteServiceGroupRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', example='1000'),
}

model DeleteServiceGroupResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model DeleteServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServiceGroupResponseBody(name='body'),
}

/**
 * @summary 删除服务组
 *
 * @param request DeleteServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServiceGroupResponse
 */
async function deleteServiceGroupWithOptions(request: DeleteServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除服务组
 *
 * @param request DeleteServiceGroupRequest
 * @return DeleteServiceGroupResponse
 */
async function deleteServiceGroup(request: DeleteServiceGroupRequest): DeleteServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteServiceGroupWithOptions(request, headers, runtime);
}

model DeleteServiceGroupSchedulingResponseBody = {
  requestId?: string(name='requestId'),
}

model DeleteServiceGroupSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServiceGroupSchedulingResponseBody(name='body'),
}

/**
 * @summary 删除排班
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServiceGroupSchedulingResponse
 */
async function deleteServiceGroupSchedulingWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): DeleteServiceGroupSchedulingResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteServiceGroupScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除排班
 *
 * @return DeleteServiceGroupSchedulingResponse
 */
async function deleteServiceGroupScheduling(): DeleteServiceGroupSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteServiceGroupSchedulingWithOptions(headers, runtime);
}

model DeleteServiceGroupUserRequest {
  clientToken?: string(name='clientToken', example='xxxxxx'),
  newUserId?: long(name='newUserId', example='88888'),
  oldUserId?: long(name='oldUserId', example='777777'),
  removeUser?: boolean(name='removeUser', example='true'),
  serviceGroupId?: long(name='serviceGroupId', example='66666'),
}

model DeleteServiceGroupUserResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model DeleteServiceGroupUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServiceGroupUserResponseBody(name='body'),
}

/**
 * @summary 删除服务组成员
 *
 * @param request DeleteServiceGroupUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServiceGroupUserResponse
 */
async function deleteServiceGroupUserWithOptions(request: DeleteServiceGroupUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteServiceGroupUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.newUserId)) {
    body['newUserId'] = request.newUserId;
  }
  if (!Util.isUnset(request.oldUserId)) {
    body['oldUserId'] = request.oldUserId;
  }
  if (!Util.isUnset(request.removeUser)) {
    body['removeUser'] = request.removeUser;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteServiceGroupUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/deleteServiceGroupUser`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除服务组成员
 *
 * @param request DeleteServiceGroupUserRequest
 * @return DeleteServiceGroupUserResponse
 */
async function deleteServiceGroupUser(request: DeleteServiceGroupUserRequest): DeleteServiceGroupUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteServiceGroupUserWithOptions(request, headers, runtime);
}

model DeleteSubscriptionRequest {
  subscriptionId?: long(name='subscriptionId', example='10'),
}

model DeleteSubscriptionResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model DeleteSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSubscriptionResponseBody(name='body'),
}

/**
 * @summary 删除通知订阅
 *
 * @param request DeleteSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSubscriptionResponse
 */
async function deleteSubscriptionWithOptions(request: DeleteSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.subscriptionId)) {
    body['subscriptionId'] = request.subscriptionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除通知订阅
 *
 * @param request DeleteSubscriptionRequest
 * @return DeleteSubscriptionResponse
 */
async function deleteSubscription(request: DeleteSubscriptionRequest): DeleteSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSubscriptionWithOptions(request, headers, runtime);
}

model DeleteUserRequest {
  clientToken?: string(name='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  userId?: long(name='userId', description='This parameter is required.', example='1'),
}

model DeleteUserResponseBody = {
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model DeleteUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserResponseBody(name='body'),
}

/**
 * @summary 删除用户
 *
 * @param request DeleteUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserResponse
 */
async function deleteUserWithOptions(request: DeleteUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/delete`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除用户
 *
 * @param request DeleteUserRequest
 * @return DeleteUserResponse
 */
async function deleteUser(request: DeleteUserRequest): DeleteUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteUserWithOptions(request, headers, runtime);
}

model DeliverIncidentRequest {
  assignUserId?: long(name='assignUserId', example='212321'),
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61CS9A221'),
  incidentId?: long(name='incidentId', example='1223212'),
}

model DeliverIncidentResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2FS'),
}

model DeliverIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeliverIncidentResponseBody(name='body'),
}

/**
 * @summary 转交事件
 *
 * @param request DeliverIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeliverIncidentResponse
 */
async function deliverIncidentWithOptions(request: DeliverIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeliverIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignUserId)) {
    body['assignUserId'] = request.assignUserId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeliverIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/deliver`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 转交事件
 *
 * @param request DeliverIncidentRequest
 * @return DeliverIncidentResponse
 */
async function deliverIncident(request: DeliverIncidentRequest): DeliverIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deliverIncidentWithOptions(request, headers, runtime);
}

model DisableEscalationPlanRequest {
  clientToken?: string(name='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='234534'),
}

model DisableEscalationPlanResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC21925D'),
}

model DisableEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 禁用升级计划
 *
 * @param request DisableEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableEscalationPlanResponse
 */
async function disableEscalationPlanWithOptions(request: DisableEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/disable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 禁用升级计划
 *
 * @param request DisableEscalationPlanRequest
 * @return DisableEscalationPlanResponse
 */
async function disableEscalationPlan(request: DisableEscalationPlanRequest): DisableEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableEscalationPlanWithOptions(request, headers, runtime);
}

model DisableIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='12345703'),
}

model DisableIntegrationConfigResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model DisableIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 禁用集成配置
 *
 * @param request DisableIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableIntegrationConfigResponse
 */
async function disableIntegrationConfigWithOptions(request: DisableIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/disable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 禁用集成配置
 *
 * @param request DisableIntegrationConfigRequest
 * @return DisableIntegrationConfigResponse
 */
async function disableIntegrationConfig(request: DisableIntegrationConfigRequest): DisableIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableIntegrationConfigWithOptions(request, headers, runtime);
}

model DisableRouteRuleRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  routeRuleId?: long(name='routeRuleId', description='This parameter is required.', example='1'),
}

model DisableRouteRuleResponseBody = {
  data?: long(name='data', description='C4BE3837-1A13-413B-A225-2C88188E8A43', example='null'),
  requestId?: string(name='requestId', description='This parameter is required.', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model DisableRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableRouteRuleResponseBody(name='body'),
}

/**
 * @summary 禁用规则
 *
 * @param request DisableRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableRouteRuleResponse
 */
async function disableRouteRuleWithOptions(request: DisableRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/disable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 禁用规则
 *
 * @param request DisableRouteRuleRequest
 * @return DisableRouteRuleResponse
 */
async function disableRouteRule(request: DisableRouteRuleRequest): DisableRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableRouteRuleWithOptions(request, headers, runtime);
}

model DisableServiceGroupWebhookRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', example='1'),
}

model DisableServiceGroupWebhookResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model DisableServiceGroupWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableServiceGroupWebhookResponseBody(name='body'),
}

/**
 * @summary 禁用服务组的webhook
 *
 * @param request DisableServiceGroupWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableServiceGroupWebhookResponse
 */
async function disableServiceGroupWebhookWithOptions(request: DisableServiceGroupWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableServiceGroupWebhookResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableServiceGroupWebhook',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/disableWebhook`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 禁用服务组的webhook
 *
 * @param request DisableServiceGroupWebhookRequest
 * @return DisableServiceGroupWebhookResponse
 */
async function disableServiceGroupWebhook(request: DisableServiceGroupWebhookRequest): DisableServiceGroupWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableServiceGroupWebhookWithOptions(request, headers, runtime);
}

model DisableSubscriptionRequest {
  subscriptionId?: long(name='subscriptionId', example='89'),
}

model DisableSubscriptionResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model DisableSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableSubscriptionResponseBody(name='body'),
}

/**
 * @summary 禁用集成配置
 *
 * @param request DisableSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableSubscriptionResponse
 */
async function disableSubscriptionWithOptions(request: DisableSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DisableSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.subscriptionId)) {
    body['subscriptionId'] = request.subscriptionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DisableSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/doDisable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 禁用集成配置
 *
 * @param request DisableSubscriptionRequest
 * @return DisableSubscriptionResponse
 */
async function disableSubscription(request: DisableSubscriptionRequest): DisableSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return disableSubscriptionWithOptions(request, headers, runtime);
}

model EnableEscalationPlanRequest {
  clientToken?: string(name='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='234534'),
}

model EnableEscalationPlanResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC21925D'),
}

model EnableEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 启用升级计划
 *
 * @param request EnableEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableEscalationPlanResponse
 */
async function enableEscalationPlanWithOptions(request: EnableEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/enable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启用升级计划
 *
 * @param request EnableEscalationPlanRequest
 * @return EnableEscalationPlanResponse
 */
async function enableEscalationPlan(request: EnableEscalationPlanRequest): EnableEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableEscalationPlanWithOptions(request, headers, runtime);
}

model EnableIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='101'),
}

model EnableIntegrationConfigResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model EnableIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 启用集成配置
 *
 * @param request EnableIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableIntegrationConfigResponse
 */
async function enableIntegrationConfigWithOptions(request: EnableIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/enable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启用集成配置
 *
 * @param request EnableIntegrationConfigRequest
 * @return EnableIntegrationConfigResponse
 */
async function enableIntegrationConfig(request: EnableIntegrationConfigRequest): EnableIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableIntegrationConfigWithOptions(request, headers, runtime);
}

model EnableRouteRuleRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  routeRuleId?: long(name='routeRuleId', description='This parameter is required.', example='1'),
}

model EnableRouteRuleResponseBody = {
  data?: int32(name='data', example='null'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model EnableRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableRouteRuleResponseBody(name='body'),
}

/**
 * @summary 启用规则
 *
 * @param request EnableRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableRouteRuleResponse
 */
async function enableRouteRuleWithOptions(request: EnableRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/enable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启用规则
 *
 * @param request EnableRouteRuleRequest
 * @return EnableRouteRuleResponse
 */
async function enableRouteRule(request: EnableRouteRuleRequest): EnableRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableRouteRuleWithOptions(request, headers, runtime);
}

model EnableServiceGroupWebhookRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', example='1'),
}

model EnableServiceGroupWebhookResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model EnableServiceGroupWebhookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableServiceGroupWebhookResponseBody(name='body'),
}

/**
 * @summary 启用服务组的webhook
 *
 * @param request EnableServiceGroupWebhookRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableServiceGroupWebhookResponse
 */
async function enableServiceGroupWebhookWithOptions(request: EnableServiceGroupWebhookRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableServiceGroupWebhookResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableServiceGroupWebhook',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/enableWebhook`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启用服务组的webhook
 *
 * @param request EnableServiceGroupWebhookRequest
 * @return EnableServiceGroupWebhookResponse
 */
async function enableServiceGroupWebhook(request: EnableServiceGroupWebhookRequest): EnableServiceGroupWebhookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableServiceGroupWebhookWithOptions(request, headers, runtime);
}

model EnableSubscriptionRequest {
  subscriptionId?: long(name='subscriptionId', example='10'),
}

model EnableSubscriptionResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model EnableSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableSubscriptionResponseBody(name='body'),
}

/**
 * @summary 启用通知订阅
 *
 * @param request EnableSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableSubscriptionResponse
 */
async function enableSubscriptionWithOptions(request: EnableSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): EnableSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.subscriptionId)) {
    body['subscriptionId'] = request.subscriptionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'EnableSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/enable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 启用通知订阅
 *
 * @param request EnableSubscriptionRequest
 * @return EnableSubscriptionResponse
 */
async function enableSubscription(request: EnableSubscriptionRequest): EnableSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return enableSubscriptionWithOptions(request, headers, runtime);
}

model FinishIncidentRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2DC'),
  incidentFinishReason?: int32(name='incidentFinishReason', example='1'),
  incidentFinishReasonDescription?: string(name='incidentFinishReasonDescription', example='原因描述'),
  incidentFinishSolution?: int32(name='incidentFinishSolution', example='3'),
  incidentFinishSolutionDescription?: string(name='incidentFinishSolutionDescription', example='解决方案描述'),
  incidentIds?: [ long ](name='incidentIds', description='This parameter is required.'),
}

model FinishIncidentResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model FinishIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishIncidentResponseBody(name='body'),
}

/**
 * @summary 完结事件
 *
 * @param request FinishIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishIncidentResponse
 */
async function finishIncidentWithOptions(request: FinishIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): FinishIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentFinishReason)) {
    body['incidentFinishReason'] = request.incidentFinishReason;
  }
  if (!Util.isUnset(request.incidentFinishReasonDescription)) {
    body['incidentFinishReasonDescription'] = request.incidentFinishReasonDescription;
  }
  if (!Util.isUnset(request.incidentFinishSolution)) {
    body['incidentFinishSolution'] = request.incidentFinishSolution;
  }
  if (!Util.isUnset(request.incidentFinishSolutionDescription)) {
    body['incidentFinishSolutionDescription'] = request.incidentFinishSolutionDescription;
  }
  if (!Util.isUnset(request.incidentIds)) {
    body['incidentIds'] = request.incidentIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FinishIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/finish`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 完结事件
 *
 * @param request FinishIncidentRequest
 * @return FinishIncidentResponse
 */
async function finishIncident(request: FinishIncidentRequest): FinishIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return finishIncidentWithOptions(request, headers, runtime);
}

model FinishProblemRequest {
  clientToken?: string(name='clientToken', example='6338F42D-ED0B-442C-932C-657300AFB4BB'),
  problemId?: long(name='problemId', example='3123'),
}

model FinishProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='6338F42D-ED0B-442C-932C-657300AFB4BB'),
}

model FinishProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FinishProblemResponseBody(name='body'),
}

/**
 * @summary 故障完结
 *
 * @param request FinishProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return FinishProblemResponse
 */
async function finishProblemWithOptions(request: FinishProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): FinishProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FinishProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/finish`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障完结
 *
 * @param request FinishProblemRequest
 * @return FinishProblemResponse
 */
async function finishProblem(request: FinishProblemRequest): FinishProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return finishProblemWithOptions(request, headers, runtime);
}

model GeneratePictureLinkRequest {
  keys?: [ string ](name='keys', description='keys'),
  problemId?: long(name='problemId', example='50002020'),
}

model GeneratePictureLinkResponseBody = {
  data?: {
    links?: [ 
      {
        key?: string(name='key', description='oss key', example='problem/38b2a36d-484d-4242-b9cf-d243e53a82c6'),
        link?: string(name='link', description='url', example='http://gam-objects-bucket.oss-cn-shanghai.aliyuncs.com/problem/38b2a36d-484d-4242-b9cf-d243e53a82c6?Expires=1625662477&OSSAccessKeyId=LTAI5tEoRVPw8GMy1iLRCno7&Signature=1NFnt%2BnudD%2F%2BHVc31b6v5%2FFxoqg%3D'),
      }
    ](name='links', description='array'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model GeneratePictureLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GeneratePictureLinkResponseBody(name='body'),
}

/**
 * @summary 图片连接获取
 *
 * @param request GeneratePictureLinkRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GeneratePictureLinkResponse
 */
async function generatePictureLinkWithOptions(request: GeneratePictureLinkRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GeneratePictureLinkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.keys)) {
    body['keys'] = request.keys;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GeneratePictureLink',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/rich/oss/getPictureLink`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 图片连接获取
 *
 * @param request GeneratePictureLinkRequest
 * @return GeneratePictureLinkResponse
 */
async function generatePictureLink(request: GeneratePictureLinkRequest): GeneratePictureLinkResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generatePictureLinkWithOptions(request, headers, runtime);
}

model GeneratePictureUploadSignRequest {
  files?: [ 
    {
      fileName?: string(name='fileName', example='文件A'),
      fileSize?: long(name='fileSize', example='100'),
      fileType?: string(name='fileType', example='JPG'),
    }
  ](name='files'),
  instanceId?: long(name='instanceId', example='123123'),
  instanceType?: string(name='instanceType', example='INCIDENT 事件 ALERT告警 PROBLEM故障'),
}

model GeneratePictureUploadSignResponseBody = {
  data?: {
    accessKeyId?: string(name='accessKeyId', description='accessKeyId', example='LTAI1tEoRVPw8GMy1iLRCno7'),
    bucketName?: string(name='bucketName', description='oss bucket name', example='gam-objects-bucket'),
    files?: [ 
      {
        fileName?: string(name='fileName', example='文件A'),
        fileSize?: long(name='fileSize', example='100'),
        fileType?: string(name='fileType', example='JPG'),
        key?: string(name='key', description='oss key', example='problem/25a2316c-b08d-41a5-9f41-b3185d529277'),
      }
    ](name='files', description='files'),
    policy?: string(name='policy', description='policy', example='eyJleHBpcmF0aW9uIjoiMjAyMS0wNy0xM1QwNDowOTo0NS4yODJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInByb2JsZW0iXV19'),
    signature?: string(name='signature', description='signature', example='SHqvIkwUNQd8Hervklir2K8U+ts='),
    url?: string(name='url', description='url', example='https://gam-objects-bucket.oss-cn-shanghai.aliyuncs.com'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='e2d4306a-bf4d-4345-9ae6-158223c85dbd'),
}

model GeneratePictureUploadSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GeneratePictureUploadSignResponseBody(name='body'),
}

/**
 * @summary 图片批量上传
 *
 * @param request GeneratePictureUploadSignRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GeneratePictureUploadSignResponse
 */
async function generatePictureUploadSignWithOptions(request: GeneratePictureUploadSignRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GeneratePictureUploadSignResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.files)) {
    body['files'] = request.files;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GeneratePictureUploadSign',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/rich/oss/generatePostPolicy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 图片批量上传
 *
 * @param request GeneratePictureUploadSignRequest
 * @return GeneratePictureUploadSignResponse
 */
async function generatePictureUploadSign(request: GeneratePictureUploadSignRequest): GeneratePictureUploadSignResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generatePictureUploadSignWithOptions(request, headers, runtime);
}

model GenerateProblemPictureLinkRequest {
  keys?: [ string ](name='keys', description='oss key'),
  problemId?: string(name='problemId', example='50002021'),
}

model GenerateProblemPictureLinkResponseBody = {
  data?: {
    links?: [ 
      {
        key?: string(name='key', description='oss key', example='problem/xxxxxxxxxx-484d-4242-b9cf-xxxxxxxxxx'),
        link?: string(name='link', example='http://xxxx-xxxx-bucket.oss-cn-xxxx.aliyuncs.com/pxxxx/38xxxxd-4789-4242-b9cfxxxxxxxxc6?Expires=1xxxxxxxxxx7&OSSAccessKeyId=xxxxxxxxxxxxxx7&Signature=xxxxxxxxxxxxxxxxxxxxxx'),
      }
    ](name='links'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='c26f36de-1ec8-496a-a828-88067879ef81'),
}

model GenerateProblemPictureLinkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateProblemPictureLinkResponseBody(name='body'),
}

/**
 * @summary 获取图片下载url
 *
 * @param request GenerateProblemPictureLinkRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateProblemPictureLinkResponse
 */
async function generateProblemPictureLinkWithOptions(request: GenerateProblemPictureLinkRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateProblemPictureLinkResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.keys)) {
    body['keys'] = request.keys;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateProblemPictureLink',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/oss/getPresignedLink`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取图片下载url
 *
 * @param request GenerateProblemPictureLinkRequest
 * @return GenerateProblemPictureLinkResponse
 */
async function generateProblemPictureLink(request: GenerateProblemPictureLinkRequest): GenerateProblemPictureLinkResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateProblemPictureLinkWithOptions(request, headers, runtime);
}

model GenerateProblemPictureUploadSignRequest {
  fileName?: string(name='fileName', example='test'),
  fileSize?: long(name='fileSize', example='1000'),
  fileType?: string(name='fileType', example='png'),
  problemId?: long(name='problemId', example='67876'),
}

model GenerateProblemPictureUploadSignResponseBody = {
  data?: {
    accessKeyId?: string(name='accessKeyId', description='ossaccessKeyId', example='XXXXXXXH8GMy1iLRCno7'),
    bucketName?: string(name='bucketName', description='oss bucket name', example='xxxx-xxxx-xxxx'),
    key?: string(name='key', description='oss key', example='problem/xxxxxxxxxxxxxxxx1-b3185d529277'),
    policy?: string(name='policy', description='policy', example='eyJleHBpcmF0a0p0IjoiMjAyMS0wNy0xM1QwNDowOTo0NS4yODJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsInByb2JsZW0iXV19'),
    signature?: string(name='signature', description='signature', example='SHqvIkwUNQd0o0rvklir2K8U+ts='),
    url?: string(name='url', description='url', example='https://xxx-xxx-bucket.oss-cn-shanghai.aliyuncs.com'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='e2d4306a-bf4d-4345-9ae6-158223c85dbd'),
}

model GenerateProblemPictureUploadSignResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateProblemPictureUploadSignResponseBody(name='body'),
}

/**
 * @summary 图片上传验签
 *
 * @param request GenerateProblemPictureUploadSignRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateProblemPictureUploadSignResponse
 */
async function generateProblemPictureUploadSignWithOptions(request: GenerateProblemPictureUploadSignRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateProblemPictureUploadSignResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fileName)) {
    body['fileName'] = request.fileName;
  }
  if (!Util.isUnset(request.fileSize)) {
    body['fileSize'] = request.fileSize;
  }
  if (!Util.isUnset(request.fileType)) {
    body['fileType'] = request.fileType;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateProblemPictureUploadSign',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/oss/generatePostPolicy`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 图片上传验签
 *
 * @param request GenerateProblemPictureUploadSignRequest
 * @return GenerateProblemPictureUploadSignResponse
 */
async function generateProblemPictureUploadSign(request: GenerateProblemPictureUploadSignRequest): GenerateProblemPictureUploadSignResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateProblemPictureUploadSignWithOptions(request, headers, runtime);
}

model GetEscalationPlanRequest {
  clientToken?: string(name='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='345'),
}

model GetEscalationPlanResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2021-09-09 09:09:09'),
    escalationPlanDescription?: string(name='escalationPlanDescription', example='描述1234'),
    escalationPlanId?: long(name='escalationPlanId', example='2345'),
    escalationPlanName?: string(name='escalationPlanName', example='升级计划234'),
    escalationPlanRules?: [ 
      {
        escalationPlanConditions?: [ 
          {
            effection?: string(name='effection', example='LOW'),
            level?: string(name='level', example='P1'),
          }
        ](name='escalationPlanConditions'),
        escalationPlanRuleId?: long(name='escalationPlanRuleId', example='345'),
        escalationPlanStrategies?: [ 
          {
            enableWebhook?: boolean(name='enableWebhook', example='true'),
            escalationPlanType?: string(name='escalationPlanType', example='UN_ACKNOWLEDGE'),
            noticeChannels?: string(name='noticeChannels', example='SMS'),
            noticeObjectList?: [ 
              {
                noticeObjectId?: long(name='noticeObjectId', example='234'),
                noticeObjectName?: string(name='noticeObjectName', example='张老三'),
              }
            ](name='noticeObjectList'),
            noticeObjects?: [ long ](name='noticeObjects'),
            noticeRoleList?: [ long ](name='noticeRoleList'),
            noticeRoleObjectList?: [ 
              {
                id?: long(name='id'),
                name?: string(name='name'),
              }
            ](name='noticeRoleObjectList'),
            noticeTime?: long(name='noticeTime', example='40'),
            serviceGroups?: [ 
              {
                id?: long(name='id', example='343'),
                serviceGroupName?: string(name='serviceGroupName', example='VCD是'),
              }
            ](name='serviceGroups'),
          }
        ](name='escalationPlanStrategies'),
      }
    ](name='escalationPlanRules'),
    escalationPlanScopeObjects?: [ 
      {
        escalationPlanScopeObjects?: int32(name='escalationPlanScopeObjects'),
        scope?: string(name='scope', example='SERVICE'),
        scopeObjectDeletedType?: int32(name='scopeObjectDeletedType'),
        scopeObjectId?: long(name='scopeObjectId', example='234'),
        scopeObjectName?: string(name='scopeObjectName', example='xx服务'),
      }
    ](name='escalationPlanScopeObjects'),
    isGlobal?: boolean(name='isGlobal'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
}

model GetEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 升级计划详情
 *
 * @param request GetEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEscalationPlanResponse
 */
async function getEscalationPlanWithOptions(request: GetEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 升级计划详情
 *
 * @param request GetEscalationPlanRequest
 * @return GetEscalationPlanResponse
 */
async function getEscalationPlan(request: GetEscalationPlanRequest): GetEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEscalationPlanWithOptions(request, headers, runtime);
}

model GetEventRequest {
  monitorSourceId?: long(name='monitorSourceId', description='This parameter is required.', example='1'),
}

model GetEventResponseBody = {
  data?: {
    eventJson?: string(name='eventJson', example='“”'),
    eventTime?: string(name='eventTime', example='2002-09-08 15:30:35'),
    monitorSourceId?: long(name='monitorSourceId', example='1'),
    monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='XXXXXXXXXXXX'),
}

model GetEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEventResponseBody(name='body'),
}

/**
 * @summary 查询最近一次告警
 *
 * @param request GetEventRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEventResponse
 */
async function getEventWithOptions(request: GetEventRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEventResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.monitorSourceId)) {
    body['monitorSourceId'] = request.monitorSourceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetEvent',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/events/getLastTimeEvent`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询最近一次告警
 *
 * @param request GetEventRequest
 * @return GetEventResponse
 */
async function getEvent(request: GetEventRequest): GetEventResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEventWithOptions(request, headers, runtime);
}

model GetHomePageGuidanceRequest {
  clientToken?: string(name='clientToken', example='xxxxxx'),
}

model GetHomePageGuidanceResponseBody = {
  data?: {
    notifySubscriptionStatus?: boolean(name='notifySubscriptionStatus', example='true'),
    serviceGroupStatus?: boolean(name='serviceGroupStatus', example='true'),
    serviceStatus?: boolean(name='serviceStatus', example='true'),
    usersStatus?: boolean(name='usersStatus', example='true'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model GetHomePageGuidanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHomePageGuidanceResponseBody(name='body'),
}

/**
 * @summary 查询首页引导信息
 *
 * @param request GetHomePageGuidanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHomePageGuidanceResponse
 */
async function getHomePageGuidanceWithOptions(request: GetHomePageGuidanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetHomePageGuidanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetHomePageGuidance',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/guidance/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询首页引导信息
 *
 * @param request GetHomePageGuidanceRequest
 * @return GetHomePageGuidanceResponse
 */
async function getHomePageGuidance(request: GetHomePageGuidanceRequest): GetHomePageGuidanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getHomePageGuidanceWithOptions(request, headers, runtime);
}

model GetIncidentRequest {
  clientToken?: string(name='clientToken', example='2b63cdef-7ac3-4892-a76d-0f3389ef729f'),
  incidentId?: long(name='incidentId', example='32113'),
}

model GetIncidentResponseBody = {
  data?: {
    assignToWhoIsValid?: int32(name='assignToWhoIsValid'),
    assignUserId?: long(name='assignUserId', example='12312'),
    assignUserName?: string(name='assignUserName', example='小明'),
    assignUserPhone?: string(name='assignUserPhone', example='1390000****'),
    createTime?: string(name='createTime', example='2020-01-10 00:00:00'),
    defaultAssignToWho?: int32(name='defaultAssignToWho'),
    defaultAssignToWhoIsValid?: int32(name='defaultAssignToWhoIsValid'),
    defaultAssignToWhoName?: string(name='defaultAssignToWhoName'),
    durationTime?: long(name='durationTime', example='3000000'),
    effect?: string(name='effect', example='LOW'),
    incidentDescription?: string(name='incidentDescription', example='事件描述'),
    incidentId?: long(name='incidentId', example='3213'),
    incidentLevel?: string(name='incidentLevel', example='P4'),
    incidentNumber?: string(name='incidentNumber', example='I3443831000000016247759753663894'),
    incidentStatus?: string(name='incidentStatus', example='FINISHE'),
    incidentTitle?: string(name='incidentTitle', example='事件标题'),
    isManual?: boolean(name='isManual', example='true'),
    isUpgrade?: boolean(name='isUpgrade', example='true'),
    notifyChannels?: [ string ](name='notifyChannels', example='1 短信  2  邮件  3  电话  4 企微群 5 钉钉群 6飞书 7 群通知 8 slack'),
    problemId?: long(name='problemId', example='232113'),
    problemNumber?: string(name='problemNumber', example='3332113231453321'),
    relRouteRuleDeleteType?: int32(name='relRouteRuleDeleteType'),
    relServiceDeleteType?: int32(name='relServiceDeleteType'),
    relServiceGroupIsValid?: int32(name='relServiceGroupIsValid'),
    relatedServiceDescription?: string(name='relatedServiceDescription', example='关联服务描述'),
    relatedServiceGroupId?: long(name='relatedServiceGroupId', example='13000'),
    relatedServiceGroupName?: string(name='relatedServiceGroupName', example='服务组A'),
    relatedServiceId?: long(name='relatedServiceId', example='312312'),
    relatedServiceName?: string(name='relatedServiceName', example='服务A'),
    routeRuleId?: long(name='routeRuleId', example='3123'),
    routeRuleName?: string(name='routeRuleName', example='流转规则A'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='2b63cdef-7ac3-4892-a76d-0f3389ef7291'),
}

model GetIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIncidentResponseBody(name='body'),
}

/**
 * @summary 事件详情
 *
 * @param request GetIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIncidentResponse
 */
async function getIncidentWithOptions(request: GetIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件详情
 *
 * @param request GetIncidentRequest
 * @return GetIncidentResponse
 */
async function getIncident(request: GetIncidentRequest): GetIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getIncidentWithOptions(request, headers, runtime);
}

model GetIncidentListByIdListRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  incidentIdList?: [ long ](name='incidentIdList'),
}

model GetIncidentListByIdListResponseBody = {
  data?: [ 
    {
      assignToWhoIsValid?: int32(name='assignToWhoIsValid', example='1'),
      assignUserId?: long(name='assignUserId', example='12312'),
      assignUserName?: string(name='assignUserName'),
      assignUserPhone?: string(name='assignUserPhone', example='139****1111'),
      createTime?: string(name='createTime', example='2010-03-09 15:53:45'),
      defaultAssignToWho?: int32(name='defaultAssignToWho', example='1212'),
      defaultAssignToWhoIsValid?: int32(name='defaultAssignToWhoIsValid', example='1'),
      defaultAssignToWhoName?: string(name='defaultAssignToWhoName'),
      durationTime?: string(name='durationTime', example='3000000'),
      effect?: string(name='effect', example='LOW'),
      incidentDescription?: string(name='incidentDescription'),
      incidentId?: long(name='incidentId', example='3213'),
      incidentLevel?: string(name='incidentLevel', example='P4'),
      incidentNumber?: string(name='incidentNumber', example='I13002001'),
      incidentStatus?: string(name='incidentStatus', example='FINISHE'),
      incidentTitle?: string(name='incidentTitle'),
      isManual?: boolean(name='isManual', example='true'),
      isUpgrade?: boolean(name='isUpgrade', example='true'),
      notifyChannels?: [ string ](name='notifyChannels'),
      problemId?: long(name='problemId', example='12312'),
      problemNumber?: string(name='problemNumber', example='P1231231'),
      relRouteRuleDeleteType?: int32(name='relRouteRuleDeleteType', example='1'),
      relServiceDeleteType?: int32(name='relServiceDeleteType', example='1'),
      relServiceGroupIsValid?: int32(name='relServiceGroupIsValid', example='1'),
      relatedServiceDescription?: string(name='relatedServiceDescription'),
      relatedServiceGroupId?: long(name='relatedServiceGroupId', example='13000'),
      relatedServiceGroupName?: string(name='relatedServiceGroupName'),
      relatedServiceId?: long(name='relatedServiceId', example='213123'),
      relatedServiceName?: string(name='relatedServiceName'),
      routeRuleId?: long(name='routeRuleId', example='10000'),
      routeRuleName?: string(name='routeRuleName'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model GetIncidentListByIdListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIncidentListByIdListResponseBody(name='body'),
}

/**
 * @summary 根据事件ID批量查询事件详情
 *
 * @param request GetIncidentListByIdListRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIncidentListByIdListResponse
 */
async function getIncidentListByIdListWithOptions(request: GetIncidentListByIdListRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetIncidentListByIdListResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentIdList)) {
    body['incidentIdList'] = request.incidentIdList;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIncidentListByIdList',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/getIncidentListByIdList`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据事件ID批量查询事件详情
 *
 * @param request GetIncidentListByIdListRequest
 * @return GetIncidentListByIdListResponse
 */
async function getIncidentListByIdList(request: GetIncidentListByIdListRequest): GetIncidentListByIdListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getIncidentListByIdListWithOptions(request, headers, runtime);
}

model GetIncidentStatisticsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetIncidentStatisticsResponseBody = {
  data?: {
    allFinish?: int32(name='allFinish', example='113'),
    allResponse?: int32(name='allResponse', example='12'),
    myFinish?: int32(name='myFinish', example='11'),
    myResponse?: int32(name='myResponse', example='1'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetIncidentStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIncidentStatisticsResponseBody(name='body'),
}

/**
 * @summary 事件统计
 *
 * @param request GetIncidentStatisticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIncidentStatisticsResponse
 */
async function getIncidentStatisticsWithOptions(request: GetIncidentStatisticsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetIncidentStatisticsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIncidentStatistics',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/count`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件统计
 *
 * @param request GetIncidentStatisticsRequest
 * @return GetIncidentStatisticsResponse
 */
async function getIncidentStatistics(request: GetIncidentStatisticsRequest): GetIncidentStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getIncidentStatisticsWithOptions(request, headers, runtime);
}

model GetIncidentSubtotalCountRequest {
  clientToken?: string(name='clientToken', example='7C56D225-7C34-40BB-9624-C8BA449260E6'),
  incidentIds?: [ long ](name='incidentIds', description='This parameter is required.'),
}

model GetIncidentSubtotalCountResponseBody = {
  data?: {
    requestId?: string(name='requestId', description='id of the request', example='24343424234'),
    subtotalCount?: map[string]any(name='subtotalCount', description='map', example='{12:12}'),
  }(name='data', description='data'),
}

model GetIncidentSubtotalCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIncidentSubtotalCountResponseBody(name='body'),
}

/**
 * @summary 查询事件对应的小计数量
 *
 * @param request GetIncidentSubtotalCountRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIncidentSubtotalCountResponse
 */
async function getIncidentSubtotalCountWithOptions(request: GetIncidentSubtotalCountRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetIncidentSubtotalCountResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentIds)) {
    body['incidentIds'] = request.incidentIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIncidentSubtotalCount',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/subtotal/count`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询事件对应的小计数量
 *
 * @param request GetIncidentSubtotalCountRequest
 * @return GetIncidentSubtotalCountResponse
 */
async function getIncidentSubtotalCount(request: GetIncidentSubtotalCountRequest): GetIncidentSubtotalCountResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getIncidentSubtotalCountWithOptions(request, headers, runtime);
}

model GetIntegrationConfigRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='68'),
}

model GetIntegrationConfigResponseBody = {
  data?: {
    accessKey?: string(name='accessKey', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
    integrationConfigId?: long(name='integrationConfigId', example='101'),
    isReceivedEvent?: boolean(name='isReceivedEvent', example='True'),
    monitorSourceId?: long(name='monitorSourceId', example='65'),
    monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
    monitorSourceShortName?: string(name='monitorSourceShortName', example='Zabbix'),
    status?: string(name='status', example='INTEGRATED'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model GetIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 获取集成配置详情
 *
 * @param request GetIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIntegrationConfigResponse
 */
async function getIntegrationConfigWithOptions(request: GetIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取集成配置详情
 *
 * @param request GetIntegrationConfigRequest
 * @return GetIntegrationConfigResponse
 */
async function getIntegrationConfig(request: GetIntegrationConfigRequest): GetIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getIntegrationConfigWithOptions(request, headers, runtime);
}

model GetProblemRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  problemId?: long(name='problemId', description='This parameter is required.', example='1'),
}

model GetProblemResponseBody = {
  data?: {
    cancelProblemOperateLogs?: [ 
      {
        actionName?: string(name='actionName', example='取消故障'),
        actionTime?: string(name='actionTime', example='2020-09-08 15:38:38'),
        operator?: string(name='operator', example='王宇'),
        userId?: long(name='userId', example='66666'),
      }
    ](name='cancelProblemOperateLogs'),
    cancelReason?: long(name='cancelReason', example='取消理由'),
    cancelReasonDescription?: string(name='cancelReasonDescription', example='理由'),
    coordinationGroups?: [ 
      {
        isValid?: long(name='isValid'),
        serviceGroupId?: long(name='serviceGroupId', example='1'),
        serviceGroupName?: string(name='serviceGroupName', example='清扫大队'),
      }
    ](name='coordinationGroups'),
    createTime?: string(name='createTime', example='2010-03-09 15:53:45'),
    discoverTime?: string(name='discoverTime', example='2010-03-09 15:53:45'),
    durationTime?: long(name='durationTime', example='300000'),
    effectionServices?: [ 
      {
        description?: string(name='description', example='描述'),
        effectionLevel?: long(name='effectionLevel', example='P1'),
        effectionServiceId?: long(name='effectionServiceId', example='1'),
        effectionStatus?: int32(name='effectionStatus', example='RESTORED'),
        serviceDeleteType?: int32(name='serviceDeleteType'),
        serviceName?: string(name='serviceName', example='购物车'),
      }
    ](name='effectionServices'),
    feedback?: string(name='feedback', example='feedback'),
    handingProblemOperateLogs?: [ 
      {
        actionName?: string(name='actionName', example='取消故障'),
        actionTime?: string(name='actionTime', example='2010-03-09 15:53:45'),
        operator?: string(name='operator', example='王宇'),
        userId?: long(name='userId', example='233'),
        userIsValid?: long(name='userIsValid'),
      }
    ](name='handingProblemOperateLogs'),
    incidentId?: long(name='incidentId', example='130000032'),
    incidentNumber?: string(name='incidentNumber', example='I3443835000012016260833157948165'),
    isRuleTrigger?: boolean(name='isRuleTrigger'),
    mainHandler?: long(name='mainHandler', example='王宇'),
    mainHandlerId?: long(name='mainHandlerId', example='2000'),
    mainHandlerIsValid?: long(name='mainHandlerIsValid'),
    mainHandlerPhone?: string(name='mainHandlerPhone', example='1308987****'),
    preliminaryReason?: string(name='preliminaryReason', example='原因'),
    problemId?: long(name='problemId', description='ID

This parameter is required.', example='1'),
    problemLevel?: int32(name='problemLevel', example='P1'),
    problemName?: string(name='problemName', example='故障'),
    problemNumber?: string(name='problemNumber', example='P34438300010030116260833538987481'),
    problemStatus?: int32(name='problemStatus', example='HANDLING'),
    progressSummary?: string(name='progressSummary', example='摘要'),
    progressSummaryRichTextId?: long(name='progressSummaryRichTextId', example='1231231'),
    recoveryTime?: string(name='recoveryTime', example='2010-03-09 15:53:45'),
    relatedServiceId?: long(name='relatedServiceId', example='1'),
    replayProblemOperateLogs?: [ 
      {
        actionName?: string(name='actionName', example='复盘故障'),
        actionTime?: string(name='actionTime', example='2020-08-08 15:39:39'),
        operator?: string(name='operator', example='周宇凡'),
        userId?: long(name='userId', example='2323'),
        userIsValid?: long(name='userIsValid'),
      }
    ](name='replayProblemOperateLogs'),
    replayingProblemOperateLogs?: [ 
      {
        actionName?: string(name='actionName', example='复盘故障'),
        actionTime?: string(name='actionTime', example='2020-08-08 15:39:39'),
        operator?: string(name='operator', example='刘杰'),
        userId?: long(name='userId', example='用户id'),
        userIsValid?: long(name='userIsValid'),
      }
    ](name='replayingProblemOperateLogs'),
    restoredProblemOperateLogs?: [ 
      {
        actionName?: string(name='actionName', example='恢复故障'),
        actionTime?: string(name='actionTime', example='2020-08-08 15:39:39'),
        operator?: string(name='operator', example='王宇'),
        userId?: long(name='userId', example='3232'),
        userIsValid?: long(name='userIsValid'),
      }
    ](name='restoredProblemOperateLogs'),
    serviceDeleteType?: int32(name='serviceDeleteType', description='serviceDeleteType'),
    serviceName?: string(name='serviceName', example='服务'),
    timelines?: [ 
      {
        keyNode?: string(name='keyNode', example='1,2,3,4,5,7,6,8,9,10'),
      }
    ](name='timelines'),
  }(name='data'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-41VB-A225-2C88188E8A43'),
}

model GetProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProblemResponseBody(name='body'),
}

/**
 * @summary 查询故障详情
 *
 * @param request GetProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProblemResponse
 */
async function getProblemWithOptions(request: GetProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询故障详情
 *
 * @param request GetProblemRequest
 * @return GetProblemResponse
 */
async function getProblem(request: GetProblemRequest): GetProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProblemWithOptions(request, headers, runtime);
}

model GetProblemEffectionServiceRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='e2d4306a-bf4d-4345-9ae6-158223c85dbd'),
  effectionServiceId?: long(name='effectionServiceId', example='9'),
  problemId?: long(name='problemId', example='46'),
}

model GetProblemEffectionServiceResponseBody = {
  data?: {
    description?: string(name='description', example='ew'),
    effectionServiceId?: long(name='effectionServiceId', example='6442430'),
    level?: long(name='level', example='P2'),
    picUrl?: [ string ](name='picUrl'),
    serviceId?: long(name='serviceId', example='170000000'),
    serviceName?: string(name='serviceName', example='哈哈'),
    status?: long(name='status', example='UN_RECOVERED'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='e2d4306a-bf4d-4345-9ae6-158223c85dbd'),
}

model GetProblemEffectionServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProblemEffectionServiceResponseBody(name='body'),
}

/**
 * @summary 查询故障影响服务
 *
 * @param request GetProblemEffectionServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProblemEffectionServiceResponse
 */
async function getProblemEffectionServiceWithOptions(request: GetProblemEffectionServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProblemEffectionServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.effectionServiceId)) {
    body['effectionServiceId'] = request.effectionServiceId;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetProblemEffectionService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/effectionService/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询故障影响服务
 *
 * @param request GetProblemEffectionServiceRequest
 * @return GetProblemEffectionServiceResponse
 */
async function getProblemEffectionService(request: GetProblemEffectionServiceRequest): GetProblemEffectionServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProblemEffectionServiceWithOptions(request, headers, runtime);
}

model GetProblemImprovementRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  problemId?: string(name='problemId', example='312312'),
}

model GetProblemImprovementResponseBody = {
  data?: {
    customProblemReason?: string(name='customProblemReason'),
    discoverSource?: string(name='discoverSource', example='1'),
    dutyDepartmentId?: string(name='dutyDepartmentId', example='12312'),
    dutyDepartmentName?: string(name='dutyDepartmentName'),
    dutyUserId?: long(name='dutyUserId', example='231'),
    dutyUserIsValid?: long(name='dutyUserIsValid'),
    dutyUserName?: string(name='dutyUserName'),
    dutyUserPhone?: string(name='dutyUserPhone', example='13098898****'),
    injectionMode?: string(name='injectionMode', example='3'),
    isManual?: boolean(name='isManual', example='true'),
    measureList?: [ 
      {
        checkStandard?: string(name='checkStandard'),
        checkUserId?: long(name='checkUserId', example='12'),
        checkUserIsValid?: int32(name='checkUserIsValid'),
        checkUserName?: string(name='checkUserName'),
        content?: string(name='content'),
        directorId?: long(name='directorId', example='212'),
        directorIsValid?: int32(name='directorIsValid'),
        directorName?: string(name='directorName'),
        measureId?: long(name='measureId', example='12312'),
        planFinishTime?: string(name='planFinishTime', example='2021-05-01 00:00:00'),
        stalkerId?: long(name='stalkerId', example='3121'),
        stalkerIsValid?: int32(name='stalkerIsValid'),
        stalkerName?: string(name='stalkerName'),
        status?: string(name='status', example='UNIMPROVED'),
        type?: long(name='type', example='2'),
      }
    ](name='measureList'),
    monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
    problemId?: string(name='problemId', example='231231'),
    problemReason?: string(name='problemReason'),
    recentActivity?: string(name='recentActivity', example='2'),
    recoveryMode?: string(name='recoveryMode', example='2'),
    relationChanges?: string(name='relationChanges'),
    remark?: string(name='remark'),
    replayDutyUserId?: long(name='replayDutyUserId', example='23123'),
    replayDutyUserIsValid?: long(name='replayDutyUserIsValid'),
    replayDutyUserName?: string(name='replayDutyUserName'),
    replayDutyUserPhone?: string(name='replayDutyUserPhone', example='1308787****'),
    userReport?: long(name='userReport', example='1'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3811'),
}

model GetProblemImprovementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProblemImprovementResponseBody(name='body'),
}

/**
 * @summary 改进分析详情
 *
 * @param request GetProblemImprovementRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProblemImprovementResponse
 */
async function getProblemImprovementWithOptions(request: GetProblemImprovementRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProblemImprovementResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetProblemImprovement',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/improvement/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改进分析详情
 *
 * @param request GetProblemImprovementRequest
 * @return GetProblemImprovementResponse
 */
async function getProblemImprovement(request: GetProblemImprovementRequest): GetProblemImprovementResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProblemImprovementWithOptions(request, headers, runtime);
}

model GetProblemPreviewRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840f13812'),
  effectServiceIds?: [ long ](name='effectServiceIds'),
  incidentId?: long(name='incidentId', example='213123'),
  problemId?: long(name='problemId', example='12312'),
  problemLevel?: string(name='problemLevel', example='P2'),
  problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_NOTIFY'),
  relatedServiceId?: long(name='relatedServiceId', example='21312'),
  serviceGroupIds?: [ long ](name='serviceGroupIds'),
}

model GetProblemPreviewResponseBody = {
  data?: {
    deAfterData?: string(name='deAfterData'),
    deBeforeData?: string(name='deBeforeData'),
    mail?: {
      count?: long(name='count', example='123'),
      users?: [ 
        {
          username?: string(name='username'),
        }
      ](name='users'),
    }(name='mail'),
    problem?: {
      coordinationGroups?: [ 
        {
          serviceGroupDescription?: string(name='serviceGroupDescription'),
          serviceGroupId?: long(name='serviceGroupId', example='1231'),
          serviceGroupName?: string(name='serviceGroupName'),
        }
      ](name='coordinationGroups'),
      createTime?: string(name='createTime', example='2021-02-21 00:00:00'),
      discoverTime?: string(name='discoverTime', example='2021-02-21 00:00:00'),
      effectionServices?: [ 
        {
          serviceId?: long(name='serviceId', example='1231'),
          serviceName?: string(name='serviceName'),
        }
      ](name='effectionServices'),
      isManual?: boolean(name='isManual', example='true'),
      isUpgrade?: boolean(name='isUpgrade', example='true'),
      mainHandlerId?: string(name='mainHandlerId', example='231'),
      mainHandlerName?: string(name='mainHandlerName'),
      preliminaryReason?: string(name='preliminaryReason'),
      problemId?: long(name='problemId', example='123123'),
      problemLevel?: string(name='problemLevel', example='P2'),
      problemName?: string(name='problemName'),
      problemStatus?: string(name='problemStatus', example='HANDLING'),
      progressSummary?: string(name='progressSummary'),
      progressSummaryRichTextId?: long(name='progressSummaryRichTextId', example='12312'),
      recoveryTime?: string(name='recoveryTime', example='2021-02-21 00:00:00'),
      relatedServiceId?: long(name='relatedServiceId', example='213123'),
      serviceName?: string(name='serviceName'),
    }(name='problem', description='object'),
    sms?: {
      count?: long(name='count', example='12'),
      users?: [ 
        {
          username?: string(name='username'),
        }
      ](name='users'),
    }(name='sms'),
    upAfterData?: string(name='upAfterData'),
    upBeforeData?: string(name='upBeforeData'),
    voice?: {
      count?: long(name='count', example='12'),
      users?: [ 
        {
          username?: string(name='username'),
        }
      ](name='users'),
    }(name='voice'),
    webhook?: {
      count?: long(name='count', example='32'),
      serviceGroups?: [ 
        {
          serviceName?: string(name='serviceName'),
        }
      ](name='serviceGroups'),
    }(name='webhook', description='webhook'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='4361a0e1-6747-4834-96ce-0c2840fd3812'),
}

model GetProblemPreviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProblemPreviewResponseBody(name='body'),
}

/**
 * @summary 通告预览
 *
 * @param request GetProblemPreviewRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProblemPreviewResponse
 */
async function getProblemPreviewWithOptions(request: GetProblemPreviewRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProblemPreviewResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.effectServiceIds)) {
    body['effectServiceIds'] = request.effectServiceIds;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemLevel)) {
    body['problemLevel'] = request.problemLevel;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.serviceGroupIds)) {
    body['serviceGroupIds'] = request.serviceGroupIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetProblemPreview',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/preview`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通告预览
 *
 * @param request GetProblemPreviewRequest
 * @return GetProblemPreviewResponse
 */
async function getProblemPreview(request: GetProblemPreviewRequest): GetProblemPreviewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProblemPreviewWithOptions(request, headers, runtime);
}

model GetResourceStatisticsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetResourceStatisticsResponseBody = {
  data?: {
    alertCount?: int32(name='alertCount', example='123'),
    incidentCount?: int32(name='incidentCount', example='1331'),
    integrationCount?: int32(name='integrationCount', example='2211'),
    problemCount?: int32(name='problemCount', example='221'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetResourceStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceStatisticsResponseBody(name='body'),
}

/**
 * @summary 概览数据统计
 *
 * @param request GetResourceStatisticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceStatisticsResponse
 */
async function getResourceStatisticsWithOptions(request: GetResourceStatisticsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetResourceStatisticsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceStatistics',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/config/resource/count`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 概览数据统计
 *
 * @param request GetResourceStatisticsRequest
 * @return GetResourceStatisticsResponse
 */
async function getResourceStatistics(request: GetResourceStatisticsRequest): GetResourceStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getResourceStatisticsWithOptions(request, headers, runtime);
}

model GetRichTextRequest {
  instanceId?: long(name='instanceId', example='INCIDENT 事件 ALERT告警 PROBLEM故障'),
  instanceType?: string(name='instanceType', example='INCIDENT'),
  richTextId?: long(name='richTextId', example='12221才'),
}

model GetRichTextResponseBody = {
  data?: {
    instanceId?: long(name='instanceId', example='123123'),
    instanceType?: long(name='instanceType', example='0 事件 1告警 2 故障'),
    richText?: string(name='richText', example='这是一个富文本'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model GetRichTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRichTextResponseBody(name='body'),
}

/**
 * @summary 查询富文本
 *
 * @param request GetRichTextRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRichTextResponse
 */
async function getRichTextWithOptions(request: GetRichTextRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetRichTextResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.richTextId)) {
    body['richTextId'] = request.richTextId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetRichText',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/rich/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询富文本
 *
 * @param request GetRichTextRequest
 * @return GetRichTextResponse
 */
async function getRichText(request: GetRichTextRequest): GetRichTextResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getRichTextWithOptions(request, headers, runtime);
}

model GetRouteRuleRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  routeRuleId?: long(name='routeRuleId', description='This parameter is required.', example='1'),
}

model GetRouteRuleResponseBody = {
  data?: {
    assignObjectId?: long(name='assignObjectId', example='1000'),
    assignObjectName?: string(name='assignObjectName', example='刘德华'),
    assignObjectType?: string(name='assignObjectType', example='SERVICEGROUP'),
    childRuleRelation?: string(name='childRuleRelation', example='AND、OR'),
    convergenceFields?: [ string ](name='convergenceFields'),
    convergenceType?: int32(name='convergenceType'),
    coverageProblemLevels?: [ string ](name='coverageProblemLevels'),
    createTime?: string(name='createTime', example='2020-09-08 15:30:30'),
    effection?: string(name='effection', example='LOW'),
    enableStatus?: string(name='enableStatus', example='DISABLE'),
    eventRouteChildRules?: [ 
      {
        childConditionRelation?: long(name='childConditionRelation', example='1'),
        childRouteRuleId?: long(name='childRouteRuleId', example='1000'),
        conditions?: [ 
          {
            key?: string(name='key', example='alarmName'),
            operationSymbol?: string(name='operationSymbol', example='contain'),
            value?: string(name='value', example='Zabbix server'),
          }
        ](name='conditions'),
        isValidChildRule?: boolean(name='isValidChildRule', example='false'),
        monitorIntegrationConfigId?: long(name='monitorIntegrationConfigId', example='1'),
        monitorSourceId?: long(name='monitorSourceId', example='1'),
        monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
        parentRuleId?: long(name='parentRuleId', example='1800'),
        problemLevel?: string(name='problemLevel'),
      }
    ](name='eventRouteChildRules'),
    incidentLevel?: string(name='incidentLevel', example='P1'),
    matchCount?: long(name='matchCount', example='3'),
    notifyChannelNames?: [ string ](name='notifyChannelNames'),
    notifyChannels?: [ string ](name='notifyChannels'),
    problemEffectionServices?: [ long ](name='problemEffectionServices'),
    problemLevelGroup?: map[string]DataProblemLevelGroupValue(name='problemLevelGroup'),
    relServiceDeleteType?: int32(name='relServiceDeleteType'),
    relatedServiceId?: long(name='relatedServiceId', example='1000'),
    relatedServiceName?: string(name='relatedServiceName', example='冲上云霄'),
    routeRuleId?: long(name='routeRuleId', example='180000000'),
    routeType?: string(name='routeType', example='INCIDENT'),
    ruleName?: string(name='ruleName', example='规则1'),
    timeWindow?: int32(name='timeWindow', example='3'),
    updateTime?: string(name='updateTime', example='2020-09-08 15:30:30'),
  }(name='data'),
  requestId?: string(name='requestId', example='6B9347ED-FD93-42B4-B9A4-7282962F5D6A'),
}

model GetRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRouteRuleResponseBody(name='body'),
}

/**
 * @summary 查询流转规则详情
 *
 * @param request GetRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRouteRuleResponse
 */
async function getRouteRuleWithOptions(request: GetRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询流转规则详情
 *
 * @param request GetRouteRuleRequest
 * @return GetRouteRuleResponse
 */
async function getRouteRule(request: GetRouteRuleRequest): GetRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getRouteRuleWithOptions(request, headers, runtime);
}

model GetServiceRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceId?: long(name='serviceId', description='This parameter is required.', example='1'),
}

model GetServiceResponseBody = {
  data?: {
    escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='1'),
    serviceDescription?: string(name='serviceDescription'),
    serviceGroupIdList?: [ long ](name='serviceGroupIdList'),
    serviceId?: long(name='serviceId', example='1'),
    serviceName?: string(name='serviceName'),
    updateTime?: string(name='updateTime', example='2020-03-08 12:53:53'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model GetServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceResponseBody(name='body'),
}

/**
 * @summary 服务详情
 *
 * @param request GetServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceResponse
 */
async function getServiceWithOptions(request: GetServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 服务详情
 *
 * @param request GetServiceRequest
 * @return GetServiceResponse
 */
async function getService(request: GetServiceRequest): GetServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceWithOptions(request, headers, runtime);
}

model GetServiceGroupRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', example='2323232'),
}

model GetServiceGroupResponseBody = {
  data?: {
    createTime?: string(name='createTime', example='2020-08-08 10:00:00'),
    enableWebhook?: string(name='enableWebhook', example='ENABLE'),
    serviceGroupDescription?: string(name='serviceGroupDescription', example='服务描述'),
    serviceGroupId?: long(name='serviceGroupId', example='1000'),
    serviceGroupName?: string(name='serviceGroupName', example='冲上云霄'),
    updateTime?: string(name='updateTime', example='2020-05-03 15:39:39'),
    users?: [ 
      {
        phone?: string(name='phone', example='1390000****'),
        roleNameList?: [ string ](name='roleNameList'),
        serviceGroupId?: long(name='serviceGroupId', example='1'),
        userId?: long(name='userId', example='10'),
        userName?: string(name='userName', example='jack'),
      }
    ](name='users'),
    webhookLink?: string(name='webhookLink', example='wwwwwww'),
    webhookType?: string(name='webhookType', example='WEIXIN_GROUP'),
  }(name='data'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model GetServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceGroupResponseBody(name='body'),
}

/**
 * @summary 查询服务组详情
 *
 * @param request GetServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceGroupResponse
 */
async function getServiceGroupWithOptions(request: GetServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组详情
 *
 * @param request GetServiceGroupRequest
 * @return GetServiceGroupResponse
 */
async function getServiceGroup(request: GetServiceGroupRequest): GetServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceGroupWithOptions(request, headers, runtime);
}

model GetServiceGroupPersonSchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  endTime?: string(name='endTime', example='2020-09-31 00:00:00'),
  serviceGroupId?: long(name='serviceGroupId', example='77777'),
  startTime?: string(name='startTime', example='2020-09-01 00:00:00'),
  userId?: long(name='userId', example='66666'),
}

model GetServiceGroupPersonSchedulingResponseBody = {
  data?: map[string]any(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxx'),
}

model GetServiceGroupPersonSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceGroupPersonSchedulingResponseBody(name='body'),
}

/**
 * @summary 查询用户某个服务组的排班
 *
 * @param request GetServiceGroupPersonSchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceGroupPersonSchedulingResponse
 */
async function getServiceGroupPersonSchedulingWithOptions(request: GetServiceGroupPersonSchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceGroupPersonSchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceGroupPersonScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/user/getScheduling`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询用户某个服务组的排班
 *
 * @param request GetServiceGroupPersonSchedulingRequest
 * @return GetServiceGroupPersonSchedulingResponse
 */
async function getServiceGroupPersonScheduling(request: GetServiceGroupPersonSchedulingRequest): GetServiceGroupPersonSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceGroupPersonSchedulingWithOptions(request, headers, runtime);
}

model GetServiceGroupSchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='9999'),
}

model GetServiceGroupSchedulingResponseBody = {
  data?: {
    fastScheduling?: {
      dutyPlan?: string(name='dutyPlan', example='FAST_CHOICE'),
      id?: long(name='id', example='2222'),
      schedulingUsers?: [ 
        {
          schedulingObjectType?: string(name='schedulingObjectType'),
          schedulingOrder?: int32(name='schedulingOrder', example='1'),
          schedulingUserId?: long(name='schedulingUserId', example='66666'),
          schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
          schedulingUserName?: string(name='schedulingUserName', example='张杰'),
        }
      ](name='schedulingUsers'),
      singleDuration?: int32(name='singleDuration', example='12'),
      singleDurationUnit?: string(name='singleDurationUnit', example='DAY'),
    }(name='fastScheduling'),
    fineScheduling?: {
      id?: long(name='id', description='1', example='精细排班ID'),
      period?: int32(name='period', description='1', example='循环周期'),
      periodUnit?: string(name='periodUnit', example='DAY'),
      schedulingFineShifts?: [ 
        {
          cycleOrder?: long(name='cycleOrder', example='1'),
          schedulingEndTime?: string(name='schedulingEndTime', example='2020-10-13'),
          schedulingObjectType?: string(name='schedulingObjectType'),
          schedulingOrder?: int32(name='schedulingOrder', example='1'),
          schedulingStartTime?: string(name='schedulingStartTime', example='2020-08-13'),
          schedulingUserId?: long(name='schedulingUserId', example='1111'),
          schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
          schedulingUserName?: string(name='schedulingUserName', example='刘德华'),
          shiftName?: string(name='shiftName', example='早班'),
          skipOneDay?: boolean(name='skipOneDay', example='false'),
        }
      ](name='schedulingFineShifts'),
      schedulingTemplateFineShifts?: [ 
        {
          schedulingEndTime?: string(name='schedulingEndTime', example='2021-10-01 00:00:00'),
          schedulingObjectType?: string(name='schedulingObjectType'),
          schedulingOrder?: long(name='schedulingOrder', example='1'),
          schedulingStartTime?: string(name='schedulingStartTime', example='2021-09-01 00:00:00'),
          schedulingUserId?: string(name='schedulingUserId', example='1'),
          schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
          schedulingUserName?: string(name='schedulingUserName'),
          shiftName?: string(name='shiftName'),
          skipOneDay?: boolean(name='skipOneDay', example='true'),
        }
      ](name='schedulingTemplateFineShifts'),
      shiftType?: string(name='shiftType', example='MORNING_NIGHT'),
    }(name='fineScheduling'),
    schedulingWay?: string(name='schedulingWay', example='FINE'),
    serviceGroupId?: long(name='serviceGroupId', example='99999'),
    users?: [ 
      {
        userId?: long(name='userId'),
        userName?: string(name='userName'),
      }
    ](name='users'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxxxxxxx'),
}

model GetServiceGroupSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceGroupSchedulingResponseBody(name='body'),
}

/**
 * @summary 查询服务组排班详情
 *
 * @param request GetServiceGroupSchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceGroupSchedulingResponse
 */
async function getServiceGroupSchedulingWithOptions(request: GetServiceGroupSchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceGroupSchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceGroupScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组排班详情
 *
 * @param request GetServiceGroupSchedulingRequest
 * @return GetServiceGroupSchedulingResponse
 */
async function getServiceGroupScheduling(request: GetServiceGroupSchedulingRequest): GetServiceGroupSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceGroupSchedulingWithOptions(request, headers, runtime);
}

model GetServiceGroupSchedulingPreviewRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  endTime?: string(name='endTime', example='2021-09-01 00:00:00'),
  fastScheduling?: {
    dutyPlan?: string(name='dutyPlan', description='FAST_CHOICE', example='FAST_CHOICE'),
    schedulingUsers?: [ 
      {
        schedulingOrder?: int32(name='schedulingOrder', example='1'),
        schedulingUserId?: long(name='schedulingUserId', example='122222'),
      }
    ](name='schedulingUsers'),
    singleDuration?: int32(name='singleDuration', example='12'),
    singleDurationUnit?: string(name='singleDurationUnit', description='DAY', example='DAY'),
  }(name='fastScheduling'),
  fineScheduling?: {
    period?: int32(name='period', example='2'),
    periodUnit?: string(name='periodUnit', example='DAY'),
    schedulingFineShifts?: [ 
      {
        schedulingEndTime?: string(name='schedulingEndTime', example='2020-10-13'),
        schedulingOrder?: long(name='schedulingOrder', example='1'),
        schedulingStartTime?: string(name='schedulingStartTime', example='2020-08-13'),
        shiftName?: string(name='shiftName', example='早班'),
      }
    ](name='schedulingFineShifts'),
    shiftType?: string(name='shiftType', example='MORNING_NIGHT'),
  }(name='fineScheduling'),
  schedulingWay?: string(name='schedulingWay', description='This parameter is required.', example='FAST'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='55555'),
  startTime?: string(name='startTime', example='2021-11-01 00:00:00'),
}

model GetServiceGroupSchedulingPreviewResponseBody = {
  data?: map[string]any(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxxxx'),
}

model GetServiceGroupSchedulingPreviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceGroupSchedulingPreviewResponseBody(name='body'),
}

/**
 * @summary 预览服务组排班
 *
 * @param request GetServiceGroupSchedulingPreviewRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceGroupSchedulingPreviewResponse
 */
async function getServiceGroupSchedulingPreviewWithOptions(request: GetServiceGroupSchedulingPreviewRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceGroupSchedulingPreviewResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.fastScheduling)) {
    body['fastScheduling'] = request.fastScheduling;
  }
  if (!Util.isUnset(request.fineScheduling)) {
    body['fineScheduling'] = request.fineScheduling;
  }
  if (!Util.isUnset(request.schedulingWay)) {
    body['schedulingWay'] = request.schedulingWay;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceGroupSchedulingPreview',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/preview`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 预览服务组排班
 *
 * @param request GetServiceGroupSchedulingPreviewRequest
 * @return GetServiceGroupSchedulingPreviewResponse
 */
async function getServiceGroupSchedulingPreview(request: GetServiceGroupSchedulingPreviewRequest): GetServiceGroupSchedulingPreviewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceGroupSchedulingPreviewWithOptions(request, headers, runtime);
}

model GetServiceGroupSpecialPersonSchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  serviceGroupId?: long(name='serviceGroupId', example='77777'),
  userId?: long(name='userId', description='This parameter is required.', example='66666'),
}

model GetServiceGroupSpecialPersonSchedulingResponseBody = {
  data?: [ 
    {
      schedulingDate?: string(name='schedulingDate', example='2021-08-17'),
      schedulingEndTime?: string(name='schedulingEndTime', example='2021-08-17  12:00:00'),
      schedulingStartTime?: string(name='schedulingStartTime', example='2021-08-17  00:00:00'),
      schedulingUserId?: long(name='schedulingUserId', example='111111'),
      serviceGroupId?: long(name='serviceGroupId', example='8888'),
      serviceGroupName?: string(name='serviceGroupName', example='刘德华'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model GetServiceGroupSpecialPersonSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceGroupSpecialPersonSchedulingResponseBody(name='body'),
}

/**
 * @summary 查询指定人员的服务组排班
 *
 * @param request GetServiceGroupSpecialPersonSchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceGroupSpecialPersonSchedulingResponse
 */
async function getServiceGroupSpecialPersonSchedulingWithOptions(request: GetServiceGroupSpecialPersonSchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceGroupSpecialPersonSchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetServiceGroupSpecialPersonScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/getUserScheduling`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询指定人员的服务组排班
 *
 * @param request GetServiceGroupSpecialPersonSchedulingRequest
 * @return GetServiceGroupSpecialPersonSchedulingResponse
 */
async function getServiceGroupSpecialPersonScheduling(request: GetServiceGroupSpecialPersonSchedulingRequest): GetServiceGroupSpecialPersonSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceGroupSpecialPersonSchedulingWithOptions(request, headers, runtime);
}

model GetSimilarIncidentStatisticsRequest {
  clientToken?: string(name='clientToken', example='7C56D225-7C34-40BB-9624-C8BA449260E6'),
  createTime?: string(name='createTime', description='This parameter is required.', example='2021-09-09 09:09:09'),
  events?: [ string ](name='events', description='This parameter is required.'),
  incidentId?: long(name='incidentId', description='This parameter is required.', example='32'),
  incidentTitle?: string(name='incidentTitle', description='This parameter is required.', example='xxx事件'),
  relatedServiceId?: long(name='relatedServiceId', description='This parameter is required.', example='23'),
}

model GetSimilarIncidentStatisticsResponseBody = {
  data?: {
    countInSevenDays?: long(name='countInSevenDays', example='8'),
    countInSixMonths?: long(name='countInSixMonths', example='43'),
    dailySimilarIncidents?: [ 
      {
        commitment?: long(name='commitment', example='0'),
        date?: string(name='date', example='2021-03-07'),
        day?: long(name='day', example='1'),
        month?: long(name='month', example='2'),
        similarIncidents?: [ 
          {
            assignUserId?: long(name='assignUserId', example='433'),
            assignUserName?: string(name='assignUserName', example='张老三'),
            createTime?: string(name='createTime', example='2021-09-09 09:09:09'),
            durationTime?: long(name='durationTime', example='6789765678'),
            finishReason?: long(name='finishReason', example='1'),
            finishReasonDescription?: string(name='finishReasonDescription', example='xx原因'),
            finishSolutionDescription?: string(name='finishSolutionDescription', example='xxx方案'),
            incidentFinishSolution?: long(name='incidentFinishSolution', example='5'),
            incidentId?: long(name='incidentId', example='5435'),
            incidentNumber?: string(name='incidentNumber', example='I234432'),
            incidentTitle?: string(name='incidentTitle', example='线性代数发多少'),
            relatedRouteRuleId?: long(name='relatedRouteRuleId', example='334'),
            relatedRouteRuleName?: string(name='relatedRouteRuleName', example='xxx规则'),
            similarScore?: string(name='similarScore', example='1003.567'),
          }
        ](name='similarIncidents'),
        week?: string(name='week', example='1'),
      }
    ](name='dailySimilarIncidents', example='{}'),
    requestId?: string(name='requestId', description='id of the request', example='uyihg6789'),
    topFiveIncidents?: [ 
      {
        assignUserId?: string(name='assignUserId', example='43'),
        assignUserName?: string(name='assignUserName', example='张老三'),
        createTime?: string(name='createTime', example='2021-09-09 09:09:09'),
        durationTime?: long(name='durationTime', example='6787678767'),
        finishReason?: long(name='finishReason', example='2'),
        finishReasonDescription?: string(name='finishReasonDescription', example='xxxx原因'),
        finishSolutionDescription?: string(name='finishSolutionDescription', example='xxx方案'),
        incidentFinishSolution?: long(name='incidentFinishSolution', example='5'),
        incidentId?: long(name='incidentId', example='32'),
        incidentNumber?: string(name='incidentNumber', example='I34324'),
        incidentTitle?: string(name='incidentTitle', example='xxx事件'),
        relatedRouteRuleId?: long(name='relatedRouteRuleId', example='4343'),
        relatedRouteRuleName?: string(name='relatedRouteRuleName', example='xxx'),
        similarScore?: string(name='similarScore', example='1992.21'),
      }
    ](name='topFiveIncidents', description='topFiveIncidents'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='7C56D225-7C34-40BB-9624-C8BA449260E6'),
}

model GetSimilarIncidentStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSimilarIncidentStatisticsResponseBody(name='body'),
}

/**
 * @summary 相似事件统计信息
 *
 * @param request GetSimilarIncidentStatisticsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSimilarIncidentStatisticsResponse
 */
async function getSimilarIncidentStatisticsWithOptions(request: GetSimilarIncidentStatisticsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSimilarIncidentStatisticsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.createTime)) {
    body['createTime'] = request.createTime;
  }
  if (!Util.isUnset(request.events)) {
    body['events'] = request.events;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }
  if (!Util.isUnset(request.incidentTitle)) {
    body['incidentTitle'] = request.incidentTitle;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSimilarIncidentStatistics',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/similarIncident/statistics`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 相似事件统计信息
 *
 * @param request GetSimilarIncidentStatisticsRequest
 * @return GetSimilarIncidentStatisticsResponse
 */
async function getSimilarIncidentStatistics(request: GetSimilarIncidentStatisticsRequest): GetSimilarIncidentStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSimilarIncidentStatisticsWithOptions(request, headers, runtime);
}

model GetSubscriptionRequest {
  notFilterScopeObjectDeleted?: boolean(name='notFilterScopeObjectDeleted'),
  subscriptionId?: long(name='subscriptionId', example='10'),
}

model GetSubscriptionResponseBody = {
  data?: {
    endTime?: string(name='endTime', example='2021-08-9 10:10:10'),
    expiredType?: string(name='expiredType', example='LONG_TERM'),
    notifyObjectList?: [ 
      {
        id?: long(name='id', example='23'),
        name?: string(name='name', example='TestName'),
        notifyObjectId?: long(name='notifyObjectId', example='19'),
        notifyObjectType?: long(name='notifyObjectType', example='USER'),
      }
    ](name='notifyObjectList'),
    notifyObjectType?: string(name='notifyObjectType', example='USER'),
    notifyStrategyList?: [ 
      {
        instanceType?: long(name='instanceType', example='INCIDENT'),
        strategies?: [ 
          {
            channels?: string(name='channels', example='SMS'),
            conditions?: [ 
              {
                action?: string(name='action', example='INCIDENT_TRIGGER'),
                effection?: string(name='effection', example='HIGH'),
                level?: string(name='level', example='P1'),
                problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_NOTIFY'),
              }
            ](name='conditions'),
            id?: long(name='id', example='12'),
            periodChannel?: {
              nonWorkday?: string(name='nonWorkday', example='DINGDING'),
              workday?: string(name='workday', example='DINGDING'),
            }(name='periodChannel'),
          }
        ](name='strategies'),
      }
    ](name='notifyStrategyList'),
    period?: string(name='period', example='1个月'),
    scope?: string(name='scope', example='SERVICE'),
    scopeObjectList?: [ 
      {
        id?: long(name='id', example='10'),
        isValid?: long(name='isValid'),
        scope?: string(name='scope', example='SERVICE'),
        scopeObject?: string(name='scopeObject'),
        scopeObjectId?: long(name='scopeObjectId', example='10'),
      }
    ](name='scopeObjectList', description='Array'),
    startTime?: string(name='startTime', example='2020-05-9 10:10:10'),
    status?: string(name='status', example='ENABLE'),
    subscriptionId?: long(name='subscriptionId', example='68'),
    subscriptionTitle?: string(name='subscriptionTitle', example='newTitle'),
  }(name='data', description='Object'),
  requestId?: string(name='requestId', description='requestId', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model GetSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSubscriptionResponseBody(name='body'),
}

/**
 * @summary 通知订阅详情
 *
 * @param request GetSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSubscriptionResponse
 */
async function getSubscriptionWithOptions(request: GetSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.notFilterScopeObjectDeleted)) {
    body['notFilterScopeObjectDeleted'] = request.notFilterScopeObjectDeleted;
  }
  if (!Util.isUnset(request.subscriptionId)) {
    body['subscriptionId'] = request.subscriptionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通知订阅详情
 *
 * @param request GetSubscriptionRequest
 * @return GetSubscriptionResponse
 */
async function getSubscription(request: GetSubscriptionRequest): GetSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSubscriptionWithOptions(request, headers, runtime);
}

model GetTenantApplicationRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='7C56D225-7C34-40BB-9624-C8BA449260E6'),
}

model GetTenantApplicationResponseBody = {
  data?: {
    bizId?: string(name='bizId', example='7356'),
    channel?: string(name='channel', example='DINGDING'),
    corporationId?: string(name='corporationId', example='ding81913c*'),
    originalCorpId?: string(name='originalCorpId'),
    progress?: string(name='progress', example='NOT_OPEN'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model GetTenantApplicationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTenantApplicationResponseBody(name='body'),
}

/**
 * @summary 云钉协同移动应用详情
 *
 * @param request GetTenantApplicationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTenantApplicationResponse
 */
async function getTenantApplicationWithOptions(request: GetTenantApplicationRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTenantApplicationResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTenantApplication',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/mobileApp/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 云钉协同移动应用详情
 *
 * @param request GetTenantApplicationRequest
 * @return GetTenantApplicationResponse
 */
async function getTenantApplication(request: GetTenantApplicationRequest): GetTenantApplicationResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTenantApplicationWithOptions(request, headers, runtime);
}

model GetTenantStatusRequest {
  tenantRamId?: long(name='tenantRamId', description='This parameter is required.'),
}

model GetTenantStatusResponseBody = {
  data?: {
    tenantStatus?: int32(name='tenantStatus'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model GetTenantStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTenantStatusResponseBody(name='body'),
}

/**
 * @summary 查询租户开通运维事件中心的状态
 *
 * @param request GetTenantStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTenantStatusResponse
 */
async function getTenantStatusWithOptions(request: GetTenantStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTenantStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.tenantRamId)) {
    body['tenantRamId'] = request.tenantRamId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetTenantStatus',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/tenant/getTenantStatus`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询租户开通运维事件中心的状态
 *
 * @param request GetTenantStatusRequest
 * @return GetTenantStatusResponse
 */
async function getTenantStatus(request: GetTenantStatusRequest): GetTenantStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTenantStatusWithOptions(request, headers, runtime);
}

model GetUserRequest {
  clientToken?: string(name='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  userId?: long(name='userId', description='This parameter is required.', example='63'),
}

model GetUserResponseBody = {
  data?: {
    accountType?: string(name='accountType', example='SUB'),
    createTime?: string(name='createTime', example='2021-09-09 09:09:09'),
    email?: string(name='email', description='email', example='5678***@qq.com'),
    isActive?: long(name='isActive'),
    isEditableUser?: boolean(name='isEditableUser', example='true'),
    isRelated?: string(name='isRelated', example='RELATE'),
    phone?: string(name='phone', example='1390000****'),
    ramId?: string(name='ramId', description='ramId', example='1344383'),
    roleIdList?: [ long ](name='roleIdList'),
    roleNameList?: [ string ](name='roleNameList'),
    serviceGroups?: [ 
      {
        name?: string(name='name', example='山口组'),
        serviceGroupId?: long(name='serviceGroupId', example='10000'),
      }
    ](name='serviceGroups'),
    userId?: long(name='userId', example='63'),
    username?: string(name='username'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model GetUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserResponseBody(name='body'),
}

/**
 * @summary 获取用户详情
 *
 * @param request GetUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserResponse
 */
async function getUserWithOptions(request: GetUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/getUser`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取用户详情
 *
 * @param request GetUserRequest
 * @return GetUserResponse
 */
async function getUser(request: GetUserRequest): GetUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getUserWithOptions(request, headers, runtime);
}

model GetUserGuideStatusRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetUserGuideStatusResponseBody = {
  data?: map[string]any(name='data', description='map', example='{   "data": {     "monitorGuide": false,     "userRamId": 1344371,     "serviceGuide": false,     "noticeGuide": false,     "userGuide": true,     "serviceGroupGuide": false,     "routeRuleGuide": false,     "incidentGuide": true   }'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model GetUserGuideStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserGuideStatusResponseBody(name='body'),
}

/**
 * @summary 查询用户新手引导状态
 *
 * @param request GetUserGuideStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserGuideStatusResponse
 */
async function getUserGuideStatusWithOptions(request: GetUserGuideStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetUserGuideStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetUserGuideStatus',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/guide/status`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询用户新手引导状态
 *
 * @param request GetUserGuideStatusRequest
 * @return GetUserGuideStatusResponse
 */
async function getUserGuideStatus(request: GetUserGuideStatusRequest): GetUserGuideStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getUserGuideStatusWithOptions(request, headers, runtime);
}

model ListAlertsRequest {
  alertLevel?: string(name='alertLevel', example='P1'),
  alertName?: string(name='alertName', example='报警'),
  alertSourceName?: string(name='alertSourceName', example='流转规则A'),
  endTime?: string(name='endTime', description='2020-09-10 21:00:00', example='2020-10-01 23:59:59'),
  monitorSourceId?: string(name='monitorSourceId'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  relatedServiceId?: long(name='relatedServiceId', example='1'),
  ruleName?: string(name='ruleName', example='zabbix'),
  startTime?: string(name='startTime', description='2020-09-10 13:00:00', example='2020-10-01 00:00:00'),
}

model ListAlertsResponseBody = {
  data?: [ 
    {
      alertId?: long(name='alertId', example='20000'),
      alertLevel?: string(name='alertLevel', example='P1'),
      alertNumber?: string(name='alertNumber', example='A123123123'),
      alertSourceName?: string(name='alertSourceName', example='zabbix'),
      createTime?: string(name='createTime', example='2020-03-05 15:53:55'),
      firstEventTime?: string(name='firstEventTime', example='2021-09-08 18:30:00'),
      monitorSourceName?: string(name='monitorSourceName'),
      relServiceDeleteType?: int32(name='relServiceDeleteType'),
      relatedServiceName?: string(name='relatedServiceName', example='服务A'),
      routeRuleDeleteType?: int32(name='routeRuleDeleteType'),
      routeRuleId?: long(name='routeRuleId', example='10000'),
      routeRuleName?: string(name='routeRuleName', example='流转规则'),
      sourceEventCount?: long(name='sourceEventCount', example='10'),
      title?: string(name='title', example='报警'),
    }
  ](name='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListAlertsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAlertsResponseBody(name='body'),
}

/**
 * @summary 报警列表查询
 *
 * @param request ListAlertsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAlertsResponse
 */
async function listAlertsWithOptions(request: ListAlertsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListAlertsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.alertLevel)) {
    body['alertLevel'] = request.alertLevel;
  }
  if (!Util.isUnset(request.alertName)) {
    body['alertName'] = request.alertName;
  }
  if (!Util.isUnset(request.alertSourceName)) {
    body['alertSourceName'] = request.alertSourceName;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.monitorSourceId)) {
    body['monitorSourceId'] = request.monitorSourceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.ruleName)) {
    body['ruleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAlerts',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/alerts/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 报警列表查询
 *
 * @param request ListAlertsRequest
 * @return ListAlertsResponse
 */
async function listAlerts(request: ListAlertsRequest): ListAlertsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listAlertsWithOptions(request, headers, runtime);
}

model ListByMonitorSourceIdRequest {
  monitorSourceId?: string(name='monitorSourceId'),
}

model ListByMonitorSourceIdResponseBody = {
  data?: [ 
    {
      id?: long(name='id'),
      ruleName?: string(name='ruleName'),
    }
  ](name='data'),
  requestId?: string(name='requestId', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model ListByMonitorSourceIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListByMonitorSourceIdResponseBody(name='body'),
}

/**
 * @summary 监控关联规则列表
 *
 * @param request ListByMonitorSourceIdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListByMonitorSourceIdResponse
 */
async function listByMonitorSourceIdWithOptions(request: ListByMonitorSourceIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListByMonitorSourceIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.monitorSourceId)) {
    body['monitorSourceId'] = request.monitorSourceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListByMonitorSourceId',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/listByMonitorSourceId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 监控关联规则列表
 *
 * @param request ListByMonitorSourceIdRequest
 * @return ListByMonitorSourceIdResponse
 */
async function listByMonitorSourceId(request: ListByMonitorSourceIdRequest): ListByMonitorSourceIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listByMonitorSourceIdWithOptions(request, headers, runtime);
}

model ListChartDataForServiceGroupRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='23es23s32xas23'),
  endTime?: string(name='endTime', example='2021-10-09'),
  startTime?: string(name='startTime', example='2021-09-09'),
}

model ListChartDataForServiceGroupResponseBody = {
  data?: [ 
    {
      effectionLevel?: map[string]any(name='effectionLevel', example='{"P1HIGH":32}'),
      escalationIncidentCount?: long(name='escalationIncidentCount', example='43'),
      incidentCount?: long(name='incidentCount', example='32'),
      meanTimeToAcknowledge?: long(name='meanTimeToAcknowledge', example='323'),
      meanTimeToRepair?: long(name='meanTimeToRepair', example='4343'),
      time?: string(name='time', example='2021-09-09'),
      totalMeanTimeToAcknowledge?: long(name='totalMeanTimeToAcknowledge', example='3334'),
      totalMeanTimeToRepair?: long(name='totalMeanTimeToRepair', example='4343'),
      unAcknowledgedEscalationIncidentCount?: long(name='unAcknowledgedEscalationIncidentCount', example='23'),
      unFinishEscalationIncidentCount?: long(name='unFinishEscalationIncidentCount', example='23'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='1231212'),
}

model ListChartDataForServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChartDataForServiceGroupResponseBody(name='body'),
}

/**
 * @summary 统计图表数据-个人
 *
 * @param request ListChartDataForServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChartDataForServiceGroupResponse
 */
async function listChartDataForServiceGroupWithOptions(request: ListChartDataForServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListChartDataForServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListChartDataForServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/statistics/chartDataForServiceGroup/`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 统计图表数据-个人
 *
 * @param request ListChartDataForServiceGroupRequest
 * @return ListChartDataForServiceGroupResponse
 */
async function listChartDataForServiceGroup(request: ListChartDataForServiceGroupRequest): ListChartDataForServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listChartDataForServiceGroupWithOptions(request, headers, runtime);
}

model ListChartDataForUserRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='3232dsd32sd32gr'),
  endTime?: string(name='endTime', example='2021-10-09'),
  startTime?: string(name='startTime', example='2021-09-09'),
}

model ListChartDataForUserResponseBody = {
  data?: [ 
    {
      effectionLevel?: map[string]any(name='effectionLevel', example='{"P1HIGH":32}'),
      escalationIncidentCount?: long(name='escalationIncidentCount', example='43'),
      incidentCount?: long(name='incidentCount', example='32'),
      meanTimeToAcknowledge?: long(name='meanTimeToAcknowledge', example='323'),
      meanTimeToRepair?: long(name='meanTimeToRepair', example='4343'),
      time?: string(name='time', example='2021-09-09'),
      totalMeanTimeToAcknowledge?: long(name='totalMeanTimeToAcknowledge', example='3334'),
      totalMeanTimeToRepair?: long(name='totalMeanTimeToRepair', example='4343'),
      unAcknowledgedEscalationIncidentCount?: long(name='unAcknowledgedEscalationIncidentCount', example='23'),
      unFinishEscalationIncidentCount?: long(name='unFinishEscalationIncidentCount', example='23'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='1231212'),
}

model ListChartDataForUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListChartDataForUserResponseBody(name='body'),
}

/**
 * @summary 统计图表数据-个人
 *
 * @param request ListChartDataForUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListChartDataForUserResponse
 */
async function listChartDataForUserWithOptions(request: ListChartDataForUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListChartDataForUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListChartDataForUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/statistics/chartDataForUser/`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 统计图表数据-个人
 *
 * @param request ListChartDataForUserRequest
 * @return ListChartDataForUserResponse
 */
async function listChartDataForUser(request: ListChartDataForUserRequest): ListChartDataForUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listChartDataForUserWithOptions(request, headers, runtime);
}

model ListConfigsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-CDE61E59A2E9'),
}

model ListConfigsResponseBody = {
  data?: map[string][ DataValue   ](name='data', description='data'),
  requestId?: string(name='requestId', description='requestId', example='uuid'),
}

model ListConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListConfigsResponseBody(name='body'),
}

/**
 * @summary 全局码表配置
 *
 * @param request ListConfigsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListConfigsResponse
 */
async function listConfigsWithOptions(request: ListConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListConfigsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListConfigs',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/config/all`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 全局码表配置
 *
 * @param request ListConfigsRequest
 * @return ListConfigsResponse
 */
async function listConfigs(request: ListConfigsRequest): ListConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listConfigsWithOptions(request, headers, runtime);
}

model ListDataReportForServiceGroupRequest {
  endTime?: string(name='endTime', example='2021-09-30'),
  pageNumber?: long(name='pageNumber'),
  pageSize?: long(name='pageSize'),
  serviceGroupName?: string(name='serviceGroupName', example='A服务组'),
  startTime?: string(name='startTime', example='2021-09-09'),
}

model ListDataReportForServiceGroupResponseBody = {
  data?: [ 
    {
      escalationIncidentCount?: long(name='escalationIncidentCount', example='100'),
      finishIncidentCount?: long(name='finishIncidentCount', example='111'),
      finishProportion?: string(name='finishProportion', example='19%'),
      incidentCount?: long(name='incidentCount', example='1'),
      meanTimeToAcknowledge?: long(name='meanTimeToAcknowledge', description='MRRA', example='3分19秒'),
      meanTimeToRepair?: long(name='meanTimeToRepair', description='MTTR', example='3分19秒'),
      serviceGroupId?: long(name='serviceGroupId', example='100'),
      serviceGroupName?: string(name='serviceGroupName', example='服务组'),
      unAcknowledgedEscalationIncidentCount?: long(name='unAcknowledgedEscalationIncidentCount', example='200'),
      unFinishEscalationIncidentCount?: long(name='unFinishEscalationIncidentCount', example='200'),
    }
  ](name='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSIze?: long(name='pageSIze', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxx'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListDataReportForServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDataReportForServiceGroupResponseBody(name='body'),
}

/**
 * @summary 查询服务组事件统计报表
 *
 * @param request ListDataReportForServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDataReportForServiceGroupResponse
 */
async function listDataReportForServiceGroupWithOptions(request: ListDataReportForServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDataReportForServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.serviceGroupName)) {
    body['serviceGroupName'] = request.serviceGroupName;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDataReportForServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/statistics/listDataReportForServiceGroup`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组事件统计报表
 *
 * @param request ListDataReportForServiceGroupRequest
 * @return ListDataReportForServiceGroupResponse
 */
async function listDataReportForServiceGroup(request: ListDataReportForServiceGroupRequest): ListDataReportForServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDataReportForServiceGroupWithOptions(request, headers, runtime);
}

model ListDataReportForUserRequest {
  endTime?: string(name='endTime', example='2021-09-30'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='100'),
  startTime?: string(name='startTime', example='2021-09-01'),
}

model ListDataReportForUserResponseBody = {
  data?: [ 
    {
      distributionIncidentCount?: long(name='distributionIncidentCount', example='100'),
      escalationIncidentCount?: long(name='escalationIncidentCount', example='100'),
      finishIncidentNumber?: long(name='finishIncidentNumber', example='100'),
      finishProportion?: string(name='finishProportion', example='20%'),
      meanTimeToAcknowledge?: string(name='meanTimeToAcknowledge', description='MRRA', example='3分50秒'),
      meanTimeToRepair?: string(name='meanTimeToRepair', description='MTTA', example='3分50秒'),
      unAcknowledgedEscalationIncidentCount?: long(name='unAcknowledgedEscalationIncidentCount', example='100'),
      unDistributionIncidentCount?: long(name='unDistributionIncidentCount', example='100'),
      unFinishEscalationIncidentCount?: long(name='unFinishEscalationIncidentCount', example='100'),
      userId?: long(name='userId', example='1111'),
      userName?: string(name='userName', example='wy'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxx'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListDataReportForUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDataReportForUserResponseBody(name='body'),
}

/**
 * @summary 查询用户事件统计报表
 *
 * @param request ListDataReportForUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDataReportForUserResponse
 */
async function listDataReportForUserWithOptions(request: ListDataReportForUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDataReportForUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDataReportForUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/statistics/listDataReportForUser`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询用户事件统计报表
 *
 * @param request ListDataReportForUserRequest
 * @return ListDataReportForUserResponse
 */
async function listDataReportForUser(request: ListDataReportForUserRequest): ListDataReportForUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDataReportForUserWithOptions(request, headers, runtime);
}

model ListDictionariesRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model ListDictionariesResponseBody = {
  data?: map[string][ DataValue   ](name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model ListDictionariesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDictionariesResponseBody(name='body'),
}

/**
 * @summary 字典列表
 *
 * @param request ListDictionariesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDictionariesResponse
 */
async function listDictionariesWithOptions(request: ListDictionariesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDictionariesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDictionaries',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/dict/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 字典列表
 *
 * @param request ListDictionariesRequest
 * @return ListDictionariesResponse
 */
async function listDictionaries(request: ListDictionariesRequest): ListDictionariesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDictionariesWithOptions(request, headers, runtime);
}

model ListEscalationPlanServicesRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
}

model ListEscalationPlanServicesResponseBody = {
  data?: [ 
    {
      scope?: string(name='scope', example='SERVICE'),
      scopeObjectId?: long(name='scopeObjectId', example='23'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
}

model ListEscalationPlanServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEscalationPlanServicesResponseBody(name='body'),
}

/**
 * @summary 获取已选中的服务对象
 *
 * @param request ListEscalationPlanServicesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEscalationPlanServicesResponse
 */
async function listEscalationPlanServicesWithOptions(request: ListEscalationPlanServicesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEscalationPlanServicesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListEscalationPlanServices',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/services`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取已选中的服务对象
 *
 * @param request ListEscalationPlanServicesRequest
 * @return ListEscalationPlanServicesResponse
 */
async function listEscalationPlanServices(request: ListEscalationPlanServicesRequest): ListEscalationPlanServicesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEscalationPlanServicesWithOptions(request, headers, runtime);
}

model ListEscalationPlansRequest {
  clientToken?: string(name='clientToken', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  escalationPlanName?: string(name='escalationPlanName', example='xxx'),
  isGlobal?: boolean(name='isGlobal'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  serviceName?: string(name='serviceName', example='ssxx'),
  status?: string(name='status'),
}

model ListEscalationPlansResponseBody = {
  data?: [ 
    {
      escalationPlanId?: long(name='escalationPlanId', example='43'),
      escalationPlanName?: string(name='escalationPlanName', example='升级计划2345'),
      escalationPlanScopeObjects?: [ 
        {
          scope?: string(name='scope', example='SERVICE'),
          scopeObjectDeletedType?: int32(name='scopeObjectDeletedType'),
          scopeObjectId?: long(name='scopeObjectId', example='23'),
          scopeObjectName?: string(name='scopeObjectName', example='某服务1'),
        }
      ](name='escalationPlanScopeObjects'),
      isGlobal?: boolean(name='isGlobal'),
      modifyTime?: string(name='modifyTime', example='2021-09-09 09:09:09'),
      status?: string(name='status', example='ENABLE'),
    }
  ](name='data', description='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
  totalCount?: long(name='totalCount', example='878'),
}

model ListEscalationPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEscalationPlansResponseBody(name='body'),
}

/**
 * @summary 升级计划列表添加服务删除字段
 *
 * @param request ListEscalationPlansRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEscalationPlansResponse
 */
async function listEscalationPlansWithOptions(request: ListEscalationPlansRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEscalationPlansResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanName)) {
    body['escalationPlanName'] = request.escalationPlanName;
  }
  if (!Util.isUnset(request.isGlobal)) {
    body['isGlobal'] = request.isGlobal;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['serviceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListEscalationPlans',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 升级计划列表添加服务删除字段
 *
 * @param request ListEscalationPlansRequest
 * @return ListEscalationPlansResponse
 */
async function listEscalationPlans(request: ListEscalationPlansRequest): ListEscalationPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEscalationPlansWithOptions(request, headers, runtime);
}

model ListEscalationPlansByNoticeObjectRequest {
  noticeObjectId?: long(name='noticeObjectId'),
  noticeObjectType?: long(name='noticeObjectType'),
}

model ListEscalationPlansByNoticeObjectResponseBody = {
  data?: [ 
    {
      escalationPlanId?: long(name='escalationPlanId'),
      escalationPlanName?: string(name='escalationPlanName'),
      escalationPlanScopeObjects?: [ 
        {
          scope?: string(name='scope'),
          scopeObjectDeletedType?: int32(name='scopeObjectDeletedType'),
          scopeObjectId?: long(name='scopeObjectId'),
          scopeObjectName?: string(name='scopeObjectName'),
        }
      ](name='escalationPlanScopeObjects'),
      modifyTime?: string(name='modifyTime'),
      status?: string(name='status'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model ListEscalationPlansByNoticeObjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEscalationPlansByNoticeObjectResponseBody(name='body'),
}

/**
 * @summary 根据推送对象查询升级策略
 *
 * @param request ListEscalationPlansByNoticeObjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEscalationPlansByNoticeObjectResponse
 */
async function listEscalationPlansByNoticeObjectWithOptions(request: ListEscalationPlansByNoticeObjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEscalationPlansByNoticeObjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.noticeObjectId)) {
    body['noticeObjectId'] = request.noticeObjectId;
  }
  if (!Util.isUnset(request.noticeObjectType)) {
    body['noticeObjectType'] = request.noticeObjectType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListEscalationPlansByNoticeObject',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/listByNoticeObject`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据推送对象查询升级策略
 *
 * @param request ListEscalationPlansByNoticeObjectRequest
 * @return ListEscalationPlansByNoticeObjectResponse
 */
async function listEscalationPlansByNoticeObject(request: ListEscalationPlansByNoticeObjectRequest): ListEscalationPlansByNoticeObjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEscalationPlansByNoticeObjectWithOptions(request, headers, runtime);
}

model ListIncidentDetailEscalationPlansRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  incidentId?: long(name='incidentId', example='2311'),
}

model ListIncidentDetailEscalationPlansResponseBody = {
  data?: {
    convergenceEscalationPlan?: [ 
      {
        escalationPlanType?: string(name='escalationPlanType', example='UN_ACKNOWLEDGE'),
        noticeChannels?: [ string ](name='noticeChannels'),
        noticeObjectList?: [ 
          {
            noticeObjectId?: long(name='noticeObjectId', example='31231'),
            noticeObjectName?: string(name='noticeObjectName', example='小华'),
            noticeObjectPhone?: string(name='noticeObjectPhone', example='130xxxxxxxxx'),
            roleNameList?: [ string ](name='roleNameList'),
          }
        ](name='noticeObjectList'),
        noticeTime?: long(name='noticeTime', example='10'),
        serviceGroupList?: [ 
          {
            id?: long(name='id', example='1231'),
            name?: string(name='name', example='服务组A'),
          }
        ](name='serviceGroupList'),
        startTime?: long(name='startTime', example='1629872386027'),
        status?: string(name='status', example='UPGRADE'),
      }
    ](name='convergenceEscalationPlan'),
    escalationPlanId?: long(name='escalationPlanId', example='312123'),
    escalationPlanName?: string(name='escalationPlanName', example='升级策略A'),
    nuAcknowledgeEscalationPlan?: [ 
      {
        escalationPlanType?: string(name='escalationPlanType', example='UN_ACKNOWLEDGE'),
        noticeChannels?: [ string ](name='noticeChannels'),
        noticeObjectList?: [ 
          {
            noticeObjectId?: long(name='noticeObjectId', example='31231'),
            noticeObjectName?: string(name='noticeObjectName', example='小华'),
            noticeObjectPhone?: string(name='noticeObjectPhone', example='130xxxxxxxxx'),
            roleNameList?: [ string ](name='roleNameList'),
          }
        ](name='noticeObjectList'),
        noticeRoleList?: [ long ](name='noticeRoleList'),
        noticeRoleObjectList?: [ 
          {
            id?: long(name='id'),
            name?: string(name='name'),
          }
        ](name='noticeRoleObjectList'),
        noticeTime?: long(name='noticeTime', example='10'),
        serviceGroupList?: [ 
          {
            id?: long(name='id', example='1231'),
            name?: string(name='name', example='服务组A'),
          }
        ](name='serviceGroupList'),
        startTime?: long(name='startTime', example='1629872386027'),
        status?: string(name='status', example='UPGRADE'),
      }
    ](name='nuAcknowledgeEscalationPlan'),
    unFinishEscalationPlan?: [ 
      {
        escalationPlanType?: string(name='escalationPlanType', example='UN_FINISH'),
        noticeChannels?: [ string ](name='noticeChannels'),
        noticeObjectList?: [ 
          {
            noticeObjectId?: long(name='noticeObjectId', example='2311'),
            noticeObjectName?: string(name='noticeObjectName', example='小明'),
            noticeObjectPhone?: string(name='noticeObjectPhone', example='130xxxxxxxx'),
            roleNameList?: [ string ](name='roleNameList'),
          }
        ](name='noticeObjectList'),
        noticeRoleList?: [ long ](name='noticeRoleList'),
        noticeRoleObjectList?: [ 
          {
            id?: long(name='id'),
            name?: string(name='name'),
          }
        ](name='noticeRoleObjectList'),
        noticeTime?: int32(name='noticeTime', example='10'),
        serviceGroupList?: [ 
          {
            id?: long(name='id', example='123132'),
            name?: string(name='name', example='服务组A'),
          }
        ](name='serviceGroupList'),
        startTime?: long(name='startTime', example='1629872386027'),
        status?: string(name='status', example='UPGRADE'),
      }
    ](name='unFinishEscalationPlan'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model ListIncidentDetailEscalationPlansResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIncidentDetailEscalationPlansResponseBody(name='body'),
}

/**
 * @summary 事件详情升级策略
 *
 * @param request ListIncidentDetailEscalationPlansRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIncidentDetailEscalationPlansResponse
 */
async function listIncidentDetailEscalationPlansWithOptions(request: ListIncidentDetailEscalationPlansRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIncidentDetailEscalationPlansResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIncidentDetailEscalationPlans',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/detail/escalation`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件详情升级策略
 *
 * @param request ListIncidentDetailEscalationPlansRequest
 * @return ListIncidentDetailEscalationPlansResponse
 */
async function listIncidentDetailEscalationPlans(request: ListIncidentDetailEscalationPlansRequest): ListIncidentDetailEscalationPlansResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIncidentDetailEscalationPlansWithOptions(request, headers, runtime);
}

model ListIncidentDetailTimelinesRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  idSort?: string(name='idSort'),
  incidentId?: long(name='incidentId', example='123'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
}

model ListIncidentDetailTimelinesResponseBody = {
  data?: [ 
    {
      action?: string(name='action', example='INCIDENT_ADD'),
      createTime?: string(name='createTime'),
      description?: string(name='description'),
      incidentId?: long(name='incidentId'),
      relRouteRuleDeleteType?: int32(name='relRouteRuleDeleteType'),
      relatedServiceName?: string(name='relatedServiceName'),
      remark?: string(name='remark'),
      snapshotData?: string(name='snapshotData'),
      title?: string(name='title'),
    }
  ](name='data', description='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  totalCount?: int32(name='totalCount'),
}

model ListIncidentDetailTimelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIncidentDetailTimelinesResponseBody(name='body'),
}

/**
 * @summary 查询事件详情动态
 *
 * @param request ListIncidentDetailTimelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIncidentDetailTimelinesResponse
 */
async function listIncidentDetailTimelinesWithOptions(request: ListIncidentDetailTimelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIncidentDetailTimelinesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.idSort)) {
    body['idSort'] = request.idSort;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIncidentDetailTimelines',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/detail/timeline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询事件详情动态
 *
 * @param request ListIncidentDetailTimelinesRequest
 * @return ListIncidentDetailTimelinesResponse
 */
async function listIncidentDetailTimelines(request: ListIncidentDetailTimelinesRequest): ListIncidentDetailTimelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIncidentDetailTimelinesWithOptions(request, headers, runtime);
}

model ListIncidentSubtotalsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE62E59A2E9'),
  incidentId?: long(name='incidentId', example='3123'),
}

model ListIncidentSubtotalsResponseBody = {
  data?: [ 
    {
      createTime?: string(name='createTime', example='2021-06-23 00:00:00'),
      createUserId?: long(name='createUserId', example='12312'),
      createUserName?: string(name='createUserName'),
      createUserPhone?: string(name='createUserPhone', example='130****1111'),
      description?: string(name='description'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model ListIncidentSubtotalsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIncidentSubtotalsResponseBody(name='body'),
}

/**
 * @summary 查询事件小计
 *
 * @param request ListIncidentSubtotalsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIncidentSubtotalsResponse
 */
async function listIncidentSubtotalsWithOptions(request: ListIncidentSubtotalsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIncidentSubtotalsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIncidentSubtotals',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/list/subtotal`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询事件小计
 *
 * @param request ListIncidentSubtotalsRequest
 * @return ListIncidentSubtotalsResponse
 */
async function listIncidentSubtotals(request: ListIncidentSubtotalsRequest): ListIncidentSubtotalsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIncidentSubtotalsWithOptions(request, headers, runtime);
}

model ListIncidentTimelinesRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
}

model ListIncidentTimelinesResponseBody = {
  data?: [ 
    {
      action?: string(name='action', example='INCIDENT_ADD'),
      createTime?: string(name='createTime', example='2021-06-23 00:00:00'),
      description?: long(name='description'),
      incidentId?: long(name='incidentId', example='3321'),
      incidentNumber?: string(name='incidentNumber', example='I13002001'),
      incidentTitle?: string(name='incidentTitle'),
      relRouteRuleDeleteType?: int32(name='relRouteRuleDeleteType'),
      relatedServiceName?: string(name='relatedServiceName'),
      remark?: string(name='remark'),
      snapshotData?: string(name='snapshotData'),
      title?: string(name='title'),
    }
  ](name='data', description='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  totalCount?: int32(name='totalCount', example='132'),
}

model ListIncidentTimelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIncidentTimelinesResponseBody(name='body'),
}

/**
 * @summary 事件动态
 *
 * @param request ListIncidentTimelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIncidentTimelinesResponse
 */
async function listIncidentTimelinesWithOptions(request: ListIncidentTimelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIncidentTimelinesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIncidentTimelines',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/timeline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件动态
 *
 * @param request ListIncidentTimelinesRequest
 * @return ListIncidentTimelinesResponse
 */
async function listIncidentTimelines(request: ListIncidentTimelinesRequest): ListIncidentTimelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIncidentTimelinesWithOptions(request, headers, runtime);
}

model ListIncidentsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E1'),
  createEndTime?: string(name='createEndTime', example='2021-11-10 00:00:00'),
  createStartTime?: string(name='createStartTime', example='2021-11-01 00:00:00'),
  effect?: string(name='effect', example='LOW'),
  incidentLevel?: string(name='incidentLevel', example='P1'),
  incidentStatus?: string(name='incidentStatus', example='ASSIGNED'),
  me?: int32(name='me', example='true'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  relationServiceId?: long(name='relationServiceId', example='12312'),
  ruleName?: string(name='ruleName', example='sa'),
}

model ListIncidentsResponseBody = {
  data?: [ 
    {
      assignToWhoIsValid?: long(name='assignToWhoIsValid'),
      assignUserId?: long(name='assignUserId', description='代表创建时间的资源属性字段', example='21312'),
      assignUserName?: string(name='assignUserName', description='代表资源一级ID的资源属性字段'),
      assignUserPhone?: string(name='assignUserPhone', example='1390000****'),
      createTime?: string(name='createTime', description='事件级别', example='2020-10-1 00:00:00'),
      effect?: string(name='effect', description='时间指派人ID', example='HIGH'),
      incidentId?: long(name='incidentId', description='修改时间', example='12321'),
      incidentLevel?: string(name='incidentLevel', description='影响程度', example='P4'),
      incidentNumber?: string(name='incidentNumber', example='I3000021'),
      incidentStatus?: string(name='incidentStatus', description='关联流转规则ID', example='RESPONDED'),
      incidentTitle?: string(name='incidentTitle', description='事件内容'),
      isManual?: boolean(name='isManual', example='true'),
      relRouteRuleDeleteType?: int32(name='relRouteRuleDeleteType'),
      relServiceDeleteType?: int32(name='relServiceDeleteType'),
      relatedServiceId?: long(name='relatedServiceId', description='事件状态', example='213123'),
      relatedServiceName?: string(name='relatedServiceName'),
      routeRuleId?: long(name='routeRuleId', description='关联的服务ID', example='123'),
      routeRuleName?: string(name='routeRuleName'),
    }
  ](name='data', description='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  totalCount?: int32(name='totalCount', example='60'),
}

model ListIncidentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIncidentsResponseBody(name='body'),
}

/**
 * @summary 获取事件列表
 *
 * @param request ListIncidentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIncidentsResponse
 */
async function listIncidentsWithOptions(request: ListIncidentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIncidentsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.createEndTime)) {
    body['createEndTime'] = request.createEndTime;
  }
  if (!Util.isUnset(request.createStartTime)) {
    body['createStartTime'] = request.createStartTime;
  }
  if (!Util.isUnset(request.effect)) {
    body['effect'] = request.effect;
  }
  if (!Util.isUnset(request.incidentLevel)) {
    body['incidentLevel'] = request.incidentLevel;
  }
  if (!Util.isUnset(request.incidentStatus)) {
    body['incidentStatus'] = request.incidentStatus;
  }
  if (!Util.isUnset(request.me)) {
    body['me'] = request.me;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.relationServiceId)) {
    body['relationServiceId'] = request.relationServiceId;
  }
  if (!Util.isUnset(request.ruleName)) {
    body['ruleName'] = request.ruleName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIncidents',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取事件列表
 *
 * @param request ListIncidentsRequest
 * @return ListIncidentsResponse
 */
async function listIncidents(request: ListIncidentsRequest): ListIncidentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIncidentsWithOptions(request, headers, runtime);
}

model ListIntegrationConfigTimelinesRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='101'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
}

model ListIntegrationConfigTimelinesResponseBody = {
  data?: [ 
    {
      createTime?: string(name='createTime', example='2021-04-05 10:10:10'),
      description?: string(name='description'),
      title?: string(name='title'),
    }
  ](name='data', description='data'),
  pageNumber?: long(name='pageNumber', description='pageNumber', example='1'),
  pageSize?: long(name='pageSize', description='pageSize', example='10'),
  requestId?: string(name='requestId', description='requestId', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  totalCount?: long(name='totalCount', description='totalCount', example='103'),
}

model ListIntegrationConfigTimelinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntegrationConfigTimelinesResponseBody(name='body'),
}

/**
 * @summary 获取集成配置动态
 *
 * @param request ListIntegrationConfigTimelinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntegrationConfigTimelinesResponse
 */
async function listIntegrationConfigTimelinesWithOptions(request: ListIntegrationConfigTimelinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIntegrationConfigTimelinesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIntegrationConfigTimelines',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/timeline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取集成配置动态
 *
 * @param request ListIntegrationConfigTimelinesRequest
 * @return ListIntegrationConfigTimelinesResponse
 */
async function listIntegrationConfigTimelines(request: ListIntegrationConfigTimelinesRequest): ListIntegrationConfigTimelinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIntegrationConfigTimelinesWithOptions(request, headers, runtime);
}

model ListIntegrationConfigsRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
}

model ListIntegrationConfigsResponseBody = {
  data?: [ 
    {
      integrationConfigId?: long(name='integrationConfigId', example='1023'),
      isReceivedEvent?: boolean(name='isReceivedEvent', example='false'),
      monitorSourceId?: long(name='monitorSourceId', example='87'),
      monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
      monitorSourceShortName?: string(name='monitorSourceShortName', example='Zabbix'),
      monitorSourceType?: int32(name='monitorSourceType'),
      status?: string(name='status', example='NOT_INTEGRATED'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model ListIntegrationConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListIntegrationConfigsResponseBody(name='body'),
}

/**
 * @summary 获取集成配置列表
 *
 * @param request ListIntegrationConfigsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListIntegrationConfigsResponse
 */
async function listIntegrationConfigsWithOptions(request: ListIntegrationConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListIntegrationConfigsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.monitorSourceName)) {
    body['monitorSourceName'] = request.monitorSourceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListIntegrationConfigs',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取集成配置列表
 *
 * @param request ListIntegrationConfigsRequest
 * @return ListIntegrationConfigsResponse
 */
async function listIntegrationConfigs(request: ListIntegrationConfigsRequest): ListIntegrationConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listIntegrationConfigsWithOptions(request, headers, runtime);
}

model ListMonitorSourcesRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378FTOKENA11'),
}

model ListMonitorSourcesResponseBody = {
  data?: [ 
    {
      fieldKeys?: [ string ](name='fieldKeys'),
      monitorSourceId?: long(name='monitorSourceId', example='12'),
      monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model ListMonitorSourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListMonitorSourcesResponseBody(name='body'),
}

/**
 * @summary ListMonitorSources
 *
 * @param request ListMonitorSourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListMonitorSourcesResponse
 */
async function listMonitorSourcesWithOptions(request: ListMonitorSourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListMonitorSourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListMonitorSources',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/monitorSource/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary ListMonitorSources
 *
 * @param request ListMonitorSourcesRequest
 * @return ListMonitorSourcesResponse
 */
async function listMonitorSources(request: ListMonitorSourcesRequest): ListMonitorSourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listMonitorSourcesWithOptions(request, headers, runtime);
}

model ListProblemDetailOperationsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  createTimeSort?: string(name='createTimeSort', example='desc,asc'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  problemId?: long(name='problemId', description='This parameter is required.', example='1'),
}

model ListProblemDetailOperationsResponseBody = {
  data?: [ 
    {
      action?: string(name='action', example='PROBLEM_CANCEL'),
      createTime?: string(name='createTime', example='2021-01-23 00:00:00'),
      description?: string(name='description', example='描述'),
      relatedServiceName?: string(name='relatedServiceName', example='服务A'),
      remark?: string(name='remark', example='备注'),
      snapshotData?: string(name='snapshotData', example='{“userName”:"小明"}'),
      title?: string(name='title', example='动态标题'),
    }
  ](name='data', description='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='requestId', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  totalCount?: int32(name='totalCount', example='210'),
}

model ListProblemDetailOperationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProblemDetailOperationsResponseBody(name='body'),
}

/**
 * @summary 故障详情动态
 *
 * @param request ListProblemDetailOperationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProblemDetailOperationsResponse
 */
async function listProblemDetailOperationsWithOptions(request: ListProblemDetailOperationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProblemDetailOperationsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.createTimeSort)) {
    body['createTimeSort'] = request.createTimeSort;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProblemDetailOperations',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/detail/operations`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障详情动态
 *
 * @param request ListProblemDetailOperationsRequest
 * @return ListProblemDetailOperationsResponse
 */
async function listProblemDetailOperations(request: ListProblemDetailOperationsRequest): ListProblemDetailOperationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProblemDetailOperationsWithOptions(request, headers, runtime);
}

model ListProblemOperationsRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
}

model ListProblemOperationsResponseBody = {
  data?: [ 
    {
      action?: string(name='action', example='PROBLEM_CANCEL'),
      createTime?: string(name='createTime', example='2021-01-23 00:00:00'),
      description?: string(name='description', example='描述'),
      problemId?: long(name='problemId', example='12312'),
      problemName?: string(name='problemName', example='这是一个故障'),
      problemNumber?: string(name='problemNumber', example='P1231231'),
      relatedServiceName?: string(name='relatedServiceName', example='服务名称'),
      snapshotData?: string(name='snapshotData', example='{“userName”:"小明"}'),
      title?: string(name='title', example='动态标题'),
    }
  ](name='data', description='data'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  totalCount?: int32(name='totalCount', example='132'),
}

model ListProblemOperationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProblemOperationsResponseBody(name='body'),
}

/**
 * @summary 查询故障7天内动态
 *
 * @param request ListProblemOperationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProblemOperationsResponse
 */
async function listProblemOperationsWithOptions(request: ListProblemOperationsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProblemOperationsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProblemOperations',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/operations`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询故障7天内动态
 *
 * @param request ListProblemOperationsRequest
 * @return ListProblemOperationsResponse
 */
async function listProblemOperations(request: ListProblemOperationsRequest): ListProblemOperationsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProblemOperationsWithOptions(request, headers, runtime);
}

model ListProblemSubtotalsRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fdB812'),
  problemId?: long(name='problemId', example='1231'),
}

model ListProblemSubtotalsResponseBody = {
  data?: [ 
    {
      createRamName?: string(name='createRamName'),
      createTime?: string(name='createTime', example='2020-10-02 00:00:00'),
      createUserId?: long(name='createUserId', example='123123'),
      createUserPhone?: string(name='createUserPhone', example='130****11111'),
      description?: string(name='description'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0S4840fd3812'),
}

model ListProblemSubtotalsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProblemSubtotalsResponseBody(name='body'),
}

/**
 * @summary 查询故障小计
 *
 * @param request ListProblemSubtotalsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProblemSubtotalsResponse
 */
async function listProblemSubtotalsWithOptions(request: ListProblemSubtotalsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProblemSubtotalsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProblemSubtotals',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/list/subtotal`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询故障小计
 *
 * @param request ListProblemSubtotalsRequest
 * @return ListProblemSubtotalsResponse
 */
async function listProblemSubtotals(request: ListProblemSubtotalsRequest): ListProblemSubtotalsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProblemSubtotalsWithOptions(request, headers, runtime);
}

model ListProblemTimeLinesRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  problemId?: long(name='problemId', example='10002010'),
}

model ListProblemTimeLinesResponseBody = {
  data?: [ 
    {
      content?: string(name='content', example='内容'),
      createTime?: string(name='createTime', example='2020-08-08 15:38:38'),
      isKey?: boolean(name='isKey', example='true'),
      keyNode?: string(name='keyNode', example='PROBLEM_INJECTION,PROBLEM_HAPPEN'),
      problemTimelineId?: long(name='problemTimelineId', example='10000'),
      time?: string(name='time', example='2020-08-08 15:38:38'),
      updateTime?: string(name='updateTime', example='2020-08-08 15:38:38'),
      usersInContent?: [ 
        {
          isValid?: long(name='isValid'),
          userId?: long(name='userId', example='232'),
          username?: string(name='username', example='张老萨'),
        }
      ](name='usersInContent'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model ListProblemTimeLinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProblemTimeLinesResponseBody(name='body'),
}

/**
 * @summary 查询故障操作时间线列表
 *
 * @param request ListProblemTimeLinesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProblemTimeLinesResponse
 */
async function listProblemTimeLinesWithOptions(request: ListProblemTimeLinesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProblemTimeLinesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProblemTimeLines',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/detail/timeLines`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询故障操作时间线列表
 *
 * @param request ListProblemTimeLinesRequest
 * @return ListProblemTimeLinesResponse
 */
async function listProblemTimeLines(request: ListProblemTimeLinesRequest): ListProblemTimeLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProblemTimeLinesWithOptions(request, headers, runtime);
}

model ListProblemsRequest {
  affectServiceId?: long(name='affectServiceId', example='1'),
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  discoveryEndTime?: string(name='discoveryEndTime', example='2020-03-05 15:50:59'),
  discoveryStartTime?: string(name='discoveryStartTime', example='2020-03-05 15:50:59'),
  mainHandlerId?: long(name='mainHandlerId', example='1'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  problemLevel?: string(name='problemLevel', example='P2'),
  problemStatus?: string(name='problemStatus', example='HANDLING'),
  queryType?: string(name='queryType', example='RESPONSIBLE'),
  repeaterId?: long(name='repeaterId', example='1'),
  restoreEndTime?: string(name='restoreEndTime', example='2020-03-05 15:50:59'),
  restoreStartTime?: string(name='restoreStartTime', example='2020-03-05 15:50:59'),
  serviceGroupId?: long(name='serviceGroupId', example='1'),
}

model ListProblemsResponseBody = {
  data?: [ 
    {
      affectServices?: [ 
        {
          serviceDescription?: string(name='serviceDescription', example='服务描述'),
          serviceId?: long(name='serviceId', example='100'),
          serviceName?: string(name='serviceName', example='冲上云霄'),
          updateTime?: string(name='updateTime', example='2020-09-08 15:59:59'),
        }
      ](name='affectServices'),
      cancelTime?: string(name='cancelTime', example='2020-09-08 15:59:59'),
      createTime?: string(name='createTime', example='2020-09-08 15:59:59'),
      discoverTime?: string(name='discoverTime', example='2020-09-08 15:59:59'),
      finishTime?: string(name='finishTime', example='2020-09-08 15:59:59'),
      incidentId?: long(name='incidentId', example='10000'),
      isManual?: boolean(name='isManual', example='true'),
      isUpgrade?: boolean(name='isUpgrade', example='true'),
      mainHandlerId?: long(name='mainHandlerId', example='100'),
      mainHandlerIsValid?: long(name='mainHandlerIsValid'),
      mainHandlerName?: string(name='mainHandlerName', example='王宇'),
      problemId?: long(name='problemId', example='1'),
      problemLevel?: string(name='problemLevel', example='P1'),
      problemName?: string(name='problemName', example='故障'),
      problemNumber?: string(name='problemNumber', example='P34438300000001116258132229577472'),
      problemStatus?: string(name='problemStatus', example='HANDLING'),
      recoveryTime?: string(name='recoveryTime', example='2020-09-08 15:59:59'),
      relatedServiceId?: string(name='relatedServiceId', example='1'),
      replayTime?: string(name='replayTime', example='2020-09-08 15:59:59'),
      serviceDeletedType?: int32(name='serviceDeletedType'),
      serviceName?: string(name='serviceName', example='服务1'),
      updateTime?: string(name='updateTime', example='2020-09-08 15:59:59'),
    }
  ](name='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListProblemsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProblemsResponseBody(name='body'),
}

/**
 * @summary 故障列表查询接口
 *
 * @param request ListProblemsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProblemsResponse
 */
async function listProblemsWithOptions(request: ListProblemsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProblemsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.affectServiceId)) {
    body['affectServiceId'] = request.affectServiceId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.discoveryEndTime)) {
    body['discoveryEndTime'] = request.discoveryEndTime;
  }
  if (!Util.isUnset(request.discoveryStartTime)) {
    body['discoveryStartTime'] = request.discoveryStartTime;
  }
  if (!Util.isUnset(request.mainHandlerId)) {
    body['mainHandlerId'] = request.mainHandlerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.problemLevel)) {
    body['problemLevel'] = request.problemLevel;
  }
  if (!Util.isUnset(request.problemStatus)) {
    body['problemStatus'] = request.problemStatus;
  }
  if (!Util.isUnset(request.queryType)) {
    body['queryType'] = request.queryType;
  }
  if (!Util.isUnset(request.repeaterId)) {
    body['repeaterId'] = request.repeaterId;
  }
  if (!Util.isUnset(request.restoreEndTime)) {
    body['restoreEndTime'] = request.restoreEndTime;
  }
  if (!Util.isUnset(request.restoreStartTime)) {
    body['restoreStartTime'] = request.restoreStartTime;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListProblems',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/listProblems`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障列表查询接口
 *
 * @param request ListProblemsRequest
 * @return ListProblemsResponse
 */
async function listProblems(request: ListProblemsRequest): ListProblemsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProblemsWithOptions(request, headers, runtime);
}

model ListRouteRulesRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  notFilterRouteRuleDeleted?: boolean(name='notFilterRouteRuleDeleted'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  routeType?: long(name='routeType', example='0'),
  ruleName?: bytes(name='ruleName', example='规则名字'),
  serviceName?: bytes(name='serviceName', example='冲上云霄'),
}

model ListRouteRulesResponseBody = {
  data?: [ 
    {
      assignObjectId?: long(name='assignObjectId', example='10'),
      assignObjectType?: string(name='assignObjectType', example='SERVICEGROUP'),
      createTime?: string(name='createTime', example='2020-03-05 15:53:55'),
      effection?: string(name='effection', example='LOW'),
      enableStatus?: string(name='enableStatus', example='DISABLE'),
      incidentLevel?: string(name='incidentLevel', example='P1'),
      isValid?: int32(name='isValid'),
      matchCount?: long(name='matchCount', example='10'),
      monitorSourceNames?: string(name='monitorSourceNames', example='zabbix'),
      relServiceDeleteType?: int32(name='relServiceDeleteType'),
      relatedServiceId?: long(name='relatedServiceId', example='1'),
      relatedServiceName?: string(name='relatedServiceName', example='关联服务名字'),
      routeRuleId?: long(name='routeRuleId', example='10000'),
      routeType?: string(name='routeType', example='INCIDENT'),
      ruleName?: string(name='ruleName', example='规则名字'),
      tenantRamId?: long(name='tenantRamId', example='1344383'),
      timeWindow?: long(name='timeWindow', example='时间窗口'),
      timeWindowUnit?: long(name='timeWindowUnit', example='MINUTE'),
      updateTime?: string(name='updateTime', example='2020-03-05 15:53:55'),
    }
  ](name='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', example='C4BE3837-1A13B-A225-2C88188E8A43'),
  totalCount?: long(name='totalCount', example='10'),
}

model ListRouteRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRouteRulesResponseBody(name='body'),
}

/**
 * @summary 查询流转规则列表
 *
 * @param request ListRouteRulesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRouteRulesResponse
 */
async function listRouteRulesWithOptions(request: ListRouteRulesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRouteRulesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.notFilterRouteRuleDeleted)) {
    body['notFilterRouteRuleDeleted'] = request.notFilterRouteRuleDeleted;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.routeType)) {
    body['routeType'] = request.routeType;
  }
  if (!Util.isUnset(request.ruleName)) {
    body['ruleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['serviceName'] = request.serviceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListRouteRules',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询流转规则列表
 *
 * @param request ListRouteRulesRequest
 * @return ListRouteRulesResponse
 */
async function listRouteRules(request: ListRouteRulesRequest): ListRouteRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRouteRulesWithOptions(request, headers, runtime);
}

model ListRouteRulesByAssignWhoIdRequest {
  assignWhoId?: long(name='assignWhoId'),
  assignWhoType?: long(name='assignWhoType'),
}

model ListRouteRulesByAssignWhoIdResponseBody = {
  data?: [ 
    {
      id?: long(name='id'),
      ruleName?: string(name='ruleName'),
      tenantRamId?: long(name='tenantRamId'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
}

model ListRouteRulesByAssignWhoIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRouteRulesByAssignWhoIdResponseBody(name='body'),
}

/**
 * @summary 获取指定分配对象的流转规则
 *
 * @param request ListRouteRulesByAssignWhoIdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRouteRulesByAssignWhoIdResponse
 */
async function listRouteRulesByAssignWhoIdWithOptions(request: ListRouteRulesByAssignWhoIdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListRouteRulesByAssignWhoIdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignWhoId)) {
    body['assignWhoId'] = request.assignWhoId;
  }
  if (!Util.isUnset(request.assignWhoType)) {
    body['assignWhoType'] = request.assignWhoType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListRouteRulesByAssignWhoId',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/listByAssignWhoId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定分配对象的流转规则
 *
 * @param request ListRouteRulesByAssignWhoIdRequest
 * @return ListRouteRulesByAssignWhoIdResponse
 */
async function listRouteRulesByAssignWhoId(request: ListRouteRulesByAssignWhoIdRequest): ListRouteRulesByAssignWhoIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRouteRulesByAssignWhoIdWithOptions(request, headers, runtime);
}

model ListRouteRulesByServiceResponseBody = {
  data?: [ 
    {
      id?: int32(name='id'),
      ruleName?: string(name='ruleName'),
    }
  ](name='data'),
  requestId?: string(name='requestId'),
  totalCount?: int32(name='totalCount'),
}

model ListRouteRulesByServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRouteRulesByServiceResponseBody(name='body'),
}

/**
 * @summary 根据服务id查询流转规则
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRouteRulesByServiceResponse
 */
async function listRouteRulesByServiceWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListRouteRulesByServiceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListRouteRulesByService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/listByService`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据服务id查询流转规则
 *
 * @return ListRouteRulesByServiceResponse
 */
async function listRouteRulesByService(): ListRouteRulesByServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listRouteRulesByServiceWithOptions(headers, runtime);
}

model ListServiceGroupMonitorSourceTemplatesRequest {
  clientToken?: string(name='clientToken', example='xxxx'),
  requestId?: string(name='requestId', example='xxxxx'),
  serviceGroupId?: long(name='serviceGroupId', example='1000'),
}

model ListServiceGroupMonitorSourceTemplatesResponseBody = {
  data?: [ 
    {
      fields?: [ string ](name='fields'),
      monitorSourceId?: long(name='monitorSourceId', example='1000'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
      templateContent?: string(name='templateContent', example='""'),
      templateId?: long(name='templateId', example='1000'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxx'),
}

model ListServiceGroupMonitorSourceTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceGroupMonitorSourceTemplatesResponseBody(name='body'),
}

/**
 * @summary 查询服务组监控源模版列表
 *
 * @param request ListServiceGroupMonitorSourceTemplatesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceGroupMonitorSourceTemplatesResponse
 */
async function listServiceGroupMonitorSourceTemplatesWithOptions(request: ListServiceGroupMonitorSourceTemplatesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceGroupMonitorSourceTemplatesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.requestId)) {
    body['requestId'] = request.requestId;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceGroupMonitorSourceTemplates',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/listServiceGroupMonitorSourceTemplates`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组监控源模版列表
 *
 * @param request ListServiceGroupMonitorSourceTemplatesRequest
 * @return ListServiceGroupMonitorSourceTemplatesResponse
 */
async function listServiceGroupMonitorSourceTemplates(request: ListServiceGroupMonitorSourceTemplatesRequest): ListServiceGroupMonitorSourceTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceGroupMonitorSourceTemplatesWithOptions(request, headers, runtime);
}

model ListServiceGroupsRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  isScheduled?: boolean(name='isScheduled', example='false'),
  orderByScheduleStatus?: boolean(name='orderByScheduleStatus', example='false'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  queryName?: string(name='queryName', example='王宇'),
  queryType?: string(name='queryType', example='USER'),
  serviceId?: long(name='serviceId'),
  userId?: long(name='userId', example='100000'),
}

model ListServiceGroupsResponseBody = {
  data?: [ 
    {
      enableWebhook?: string(name='enableWebhook', example='ENABLE'),
      isScheduled?: boolean(name='isScheduled', example='true'),
      serviceGroupDescription?: string(name='serviceGroupDescription', example='服务描述'),
      serviceGroupId?: long(name='serviceGroupId', example='1'),
      serviceGroupName?: string(name='serviceGroupName', example='服务组'),
      updateTime?: string(name='updateTime', example='2020-08-09 15:50:30'),
      users?: [ 
        {
          email?: string(name='email', example='wy930***@163.com'),
          isRelated?: int32(name='isRelated'),
          phone?: string(name='phone', example='1390000****'),
          serviceGroupId?: long(name='serviceGroupId', example='1'),
          userId?: long(name='userId', example='10'),
          userName?: string(name='userName', example='jack'),
        }
      ](name='users'),
      webhookLink?: string(name='webhookLink', example='wwwwwwwwww'),
      webhookType?: string(name='webhookType', example='WEIXIN_GROUP'),
    }
  ](name='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='sssss'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListServiceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceGroupsResponseBody(name='body'),
}

/**
 * @summary 查询服务组列表
 *
 * @param request ListServiceGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceGroupsResponse
 */
async function listServiceGroupsWithOptions(request: ListServiceGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.isScheduled)) {
    body['isScheduled'] = request.isScheduled;
  }
  if (!Util.isUnset(request.orderByScheduleStatus)) {
    body['orderByScheduleStatus'] = request.orderByScheduleStatus;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryName)) {
    body['queryName'] = request.queryName;
  }
  if (!Util.isUnset(request.queryType)) {
    body['queryType'] = request.queryType;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListServiceGroups',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组列表
 *
 * @param request ListServiceGroupsRequest
 * @return ListServiceGroupsResponse
 */
async function listServiceGroups(request: ListServiceGroupsRequest): ListServiceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceGroupsWithOptions(request, headers, runtime);
}

model ListServiceGroupsByUserIdResponseBody = {
  data?: {
    isScheduled?: boolean(name='isScheduled'),
    serviceGroupId?: long(name='serviceGroupId'),
    serviceGroupName?: string(name='serviceGroupName'),
  }(name='data'),
  requestId?: string(name='requestId'),
}

model ListServiceGroupsByUserIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServiceGroupsByUserIdResponseBody(name='body'),
}

/**
 * @summary 根据成员id查服务组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServiceGroupsByUserIdResponse
 */
async function listServiceGroupsByUserIdWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListServiceGroupsByUserIdResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListServiceGroupsByUserId',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/listByUserId`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据成员id查服务组
 *
 * @return ListServiceGroupsByUserIdResponse
 */
async function listServiceGroupsByUserId(): ListServiceGroupsByUserIdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServiceGroupsByUserIdWithOptions(headers, runtime);
}

model ListServicesRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  pageNumber?: long(name='pageNumber', description='This parameter is required.', example='1'),
  pageSize?: long(name='pageSize', description='This parameter is required.', example='10'),
  serviceName?: string(name='serviceName', example='冲上云霄'),
}

model ListServicesResponseBody = {
  data?: [ 
    {
      escalationPlanId?: long(name='escalationPlanId'),
      escalationPlanName?: string(name='escalationPlanName'),
      isValid?: int32(name='isValid'),
      serviceDescription?: string(name='serviceDescription', example='服务描述'),
      serviceGroupIdList?: [ long ](name='serviceGroupIdList'),
      serviceId?: long(name='serviceId', example='1'),
      serviceName?: string(name='serviceName', example='冲上云霄'),
      updateTime?: string(name='updateTime', example='2020-09-08 14:30:30'),
    }
  ](name='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListServicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServicesResponseBody(name='body'),
}

/**
 * @summary 查询服务组列表
 *
 * @param request ListServicesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServicesResponse
 */
async function listServicesWithOptions(request: ListServicesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListServicesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['serviceName'] = request.serviceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListServices',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询服务组列表
 *
 * @param request ListServicesRequest
 * @return ListServicesResponse
 */
async function listServices(request: ListServicesRequest): ListServicesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listServicesWithOptions(request, headers, runtime);
}

model ListSourceEventsRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  endTime?: string(name='endTime', description='2020-09-18 13:00:00', example='2020-10-01 23:59:59'),
  instanceId?: long(name='instanceId', description='This parameter is required.', example='1'),
  instanceType?: string(name='instanceType', description='This parameter is required.', example='INCIDENT'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  startRowKey?: string(name='startRowKey', example='9223370410626682599-1344383-78954515-1-0a6e01a1701447fd9ef18b079edd2c6d'),
  startTime?: string(name='startTime', description='2020-09-10 13:00:00', example='2020-10-01 00:00:00'),
  stopRowKey?: string(name='stopRowKey', example='9223370410626682599-1344383-78954515-1-0a6e01a1701447fd9ef18b079edd2c6d'),
}

model ListSourceEventsResponseBody = {
  data?: [ 
    {
      eventJson?: string(name='eventJson', example='""'),
      eventTime?: string(name='eventTime', example='2020-09-08 15:53:34'),
      instanceId?: long(name='instanceId', example='1'),
      instanceType?: string(name='instanceType', example='INCIDENT'),
      monitorSourceId?: long(name='monitorSourceId', example='1'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
      routeRuleId?: long(name='routeRuleId', example='1'),
      tenantRamId?: long(name='tenantRamId', example='1'),
    }
  ](name='data'),
  firstRowKey?: string(name='firstRowKey', description='firstRowKey', example='9223370412331485032-1344383-9967-1-08be8b08ef30441390072f3bfba71c94'),
  lastRowKey?: string(name='lastRowKey', description='lastRowKey', example='9223370412331485036-1344383-9967-1-8d729a1b176f493ca3be643b391d5ced'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListSourceEventsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSourceEventsResponseBody(name='body'),
}

/**
 * @summary 原始告警列表查询
 *
 * @param request ListSourceEventsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSourceEventsResponse
 */
async function listSourceEventsWithOptions(request: ListSourceEventsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSourceEventsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startRowKey)) {
    body['startRowKey'] = request.startRowKey;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.stopRowKey)) {
    body['stopRowKey'] = request.stopRowKey;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSourceEvents',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/events/listOriginalEvent`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 原始告警列表查询
 *
 * @param request ListSourceEventsRequest
 * @return ListSourceEventsResponse
 */
async function listSourceEvents(request: ListSourceEventsRequest): ListSourceEventsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSourceEventsWithOptions(request, headers, runtime);
}

model ListSourceEventsForMonitorSourceRequest {
  monitorSourceId?: long(name='monitorSourceId', example='1000'),
}

model ListSourceEventsForMonitorSourceResponseBody = {
  data?: [ 
    {
      eventJson?: string(name='eventJson', example='{}'),
      eventTime?: string(name='eventTime', example='2020-01-01 18:30:00'),
      monitorSourceId?: boolean(name='monitorSourceId', example='1000'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model ListSourceEventsForMonitorSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSourceEventsForMonitorSourceResponseBody(name='body'),
}

/**
 * @summary 查询监控员最近10次告警
 *
 * @param request ListSourceEventsForMonitorSourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSourceEventsForMonitorSourceResponse
 */
async function listSourceEventsForMonitorSourceWithOptions(request: ListSourceEventsForMonitorSourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSourceEventsForMonitorSourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.monitorSourceId)) {
    body['monitorSourceId'] = request.monitorSourceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSourceEventsForMonitorSource',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/events/queryLastestEvents`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询监控员最近10次告警
 *
 * @param request ListSourceEventsForMonitorSourceRequest
 * @return ListSourceEventsForMonitorSourceResponse
 */
async function listSourceEventsForMonitorSource(request: ListSourceEventsForMonitorSourceRequest): ListSourceEventsForMonitorSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSourceEventsForMonitorSourceWithOptions(request, headers, runtime);
}

model ListSubscriptionServiceGroupsRequest {
  clientToken?: string(name='clientToken', example='89f51d2e-5527-4f6c-a6c6-4411b5496e9f'),
  serviceIds?: [ long ](name='serviceIds'),
}

model ListSubscriptionServiceGroupsResponseBody = {
  data?: [ 
    {
      serviceGroupDescription?: string(name='serviceGroupDescription'),
      serviceId?: long(name='serviceId', example='123113'),
      serviceName?: string(name='serviceName'),
    }
  ](name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='89f51d2e-5527-4f6c-a6c6-4411b5496e9f'),
}

model ListSubscriptionServiceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSubscriptionServiceGroupsResponseBody(name='body'),
}

/**
 * @summary 订阅通知服务组查询
 *
 * @param request ListSubscriptionServiceGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSubscriptionServiceGroupsResponse
 */
async function listSubscriptionServiceGroupsWithOptions(request: ListSubscriptionServiceGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSubscriptionServiceGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.serviceIds)) {
    body['serviceIds'] = request.serviceIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSubscriptionServiceGroups',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/serviceGroup/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 订阅通知服务组查询
 *
 * @param request ListSubscriptionServiceGroupsRequest
 * @return ListSubscriptionServiceGroupsResponse
 */
async function listSubscriptionServiceGroups(request: ListSubscriptionServiceGroupsRequest): ListSubscriptionServiceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSubscriptionServiceGroupsWithOptions(request, headers, runtime);
}

model ListSubscriptionsRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378FTOKENA11'),
  notFilterScopeObjectDeleted?: boolean(name='notFilterScopeObjectDeleted'),
  notifyObject?: string(name='notifyObject', example='test'),
  notifyObjectType?: string(name='notifyObjectType', example='SERVICE'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  scope?: string(name='scope', example='SERVICE'),
  scopeObject?: string(name='scopeObject', example='TestName'),
  subscriptionTitle?: string(name='subscriptionTitle', example='newTitle'),
}

model ListSubscriptionsResponseBody = {
  data?: [ 
    {
      endTime?: string(name='endTime', example='2022-05-09 10:10:10'),
      expiredType?: string(name='expiredType', example='LONG_TERM'),
      notifyObjectList?: [ 
        {
          id?: long(name='id', example='10'),
          isValid?: long(name='isValid'),
          name?: string(name='name', example='张珊'),
          notifyObjectId?: long(name='notifyObjectId', example='10'),
          notifyObjectType?: long(name='notifyObjectType', example='USER'),
        }
      ](name='notifyObjectList'),
      notifyObjectType?: long(name='notifyObjectType', example='USER'),
      scope?: long(name='scope', example='SERVICE'),
      scopeObjectList?: [ 
        {
          id?: long(name='id', example='10'),
          isValid?: long(name='isValid'),
          scope?: long(name='scope', example='SERVICE'),
          scopeObject?: string(name='scopeObject', example='阿里云服务'),
          scopeObjectId?: long(name='scopeObjectId', example='10'),
        }
      ](name='scopeObjectList'),
      startTime?: string(name='startTime', example='2020-05-09 10:10:10'),
      status?: string(name='status', example='ENABLE'),
      subscriptionId?: long(name='subscriptionId', example='10'),
      subscriptionTitle?: string(name='subscriptionTitle', example='test'),
    }
  ](name='data', description='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListSubscriptionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSubscriptionsResponseBody(name='body'),
}

/**
 * @summary 通知订阅列表
 *
 * @param request ListSubscriptionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSubscriptionsResponse
 */
async function listSubscriptionsWithOptions(request: ListSubscriptionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSubscriptionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.notFilterScopeObjectDeleted)) {
    body['notFilterScopeObjectDeleted'] = request.notFilterScopeObjectDeleted;
  }
  if (!Util.isUnset(request.notifyObject)) {
    body['notifyObject'] = request.notifyObject;
  }
  if (!Util.isUnset(request.notifyObjectType)) {
    body['notifyObjectType'] = request.notifyObjectType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.scopeObject)) {
    body['scopeObject'] = request.scopeObject;
  }
  if (!Util.isUnset(request.subscriptionTitle)) {
    body['subscriptionTitle'] = request.subscriptionTitle;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListSubscriptions',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 通知订阅列表
 *
 * @param request ListSubscriptionsRequest
 * @return ListSubscriptionsResponse
 */
async function listSubscriptions(request: ListSubscriptionsRequest): ListSubscriptionsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSubscriptionsWithOptions(request, headers, runtime);
}

model ListTrendForSourceEventRequest {
  endTime?: string(name='endTime', example='2020-10-10 23:59:59'),
  instanceId?: long(name='instanceId', example='1000'),
  instanceType?: string(name='instanceType', example='INCIDENT'),
  requestId?: string(name='requestId', example='xxxx'),
  startTime?: string(name='startTime', example='2020-10-10 00:00:00'),
  timeUnit?: long(name='timeUnit', example='1000'),
}

model ListTrendForSourceEventResponseBody = {
  data?: [ 
    {
      convergenceRate?: string(name='convergenceRate', example='90.90%'),
      maxSustainTime?: long(name='maxSustainTime', example='10920312312312'),
      skipDay?: boolean(name='skipDay', example='true'),
      sourceEventsStatMap?: map[string]any(name='sourceEventsStatMap', example='{             "Grafana": [                 {                     "evenTime": "2021-11-15 14:29:59",                     "eventCount": 4,                     "monitorSourceName": "Grafana",                     "monitorSourceCounts": null,                     "sustainTime": 15646                 },                 {                     "evenTime": "2021-11-15 14:30:36",                     "eventCount": 7,                     "monitorSourceName": "Grafana",                     "monitorSourceCounts": null,                     "sustainTime": 52638                 }             ]         }'),
      unit?: string(name='unit', example='1000'),
    }
  ](name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxx'),
}

model ListTrendForSourceEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrendForSourceEventResponseBody(name='body'),
}

/**
 * @summary 查询原始告警趋势
 *
 * @param request ListTrendForSourceEventRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTrendForSourceEventResponse
 */
async function listTrendForSourceEventWithOptions(request: ListTrendForSourceEventRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTrendForSourceEventResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.requestId)) {
    body['requestId'] = request.requestId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.timeUnit)) {
    body['timeUnit'] = request.timeUnit;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListTrendForSourceEvent',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/events/querySourceEventTrend`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询原始告警趋势
 *
 * @param request ListTrendForSourceEventRequest
 * @return ListTrendForSourceEventResponse
 */
async function listTrendForSourceEvent(request: ListTrendForSourceEventRequest): ListTrendForSourceEventResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTrendForSourceEventWithOptions(request, headers, runtime);
}

model ListUserSerivceGroupsRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='2b63cdef-7ac3-4892-a76d-0f3389ef729f'),
  userId?: long(name='userId', description='This parameter is required.', example='123'),
}

model ListUserSerivceGroupsResponseBody = {
  data?: {
    email?: string(name='email', example='12121****@163.com'),
    phone?: string(name='phone', example='1390000****'),
    ramId?: long(name='ramId', example='321'),
    serviceGroups?: [ 
      {
        serviceGroupDescription?: string(name='serviceGroupDescription', example='描述'),
        serviceGroupId?: long(name='serviceGroupId', example='123'),
        serviceGroupName?: string(name='serviceGroupName', example='服务组A'),
      }
    ](name='serviceGroups'),
    userId?: long(name='userId', example='321'),
    username?: string(name='username', example='小明'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='2b63cdef-7ac3-4892-a76d-0f3389ef7291'),
}

model ListUserSerivceGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserSerivceGroupsResponseBody(name='body'),
}

/**
 * @summary 用户预览
 *
 * @param request ListUserSerivceGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserSerivceGroupsResponse
 */
async function listUserSerivceGroupsWithOptions(request: ListUserSerivceGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUserSerivceGroupsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListUserSerivceGroups',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/preview/detail`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 用户预览
 *
 * @param request ListUserSerivceGroupsRequest
 * @return ListUserSerivceGroupsResponse
 */
async function listUserSerivceGroups(request: ListUserSerivceGroupsRequest): ListUserSerivceGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUserSerivceGroupsWithOptions(request, headers, runtime);
}

model ListUsersRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  phone?: string(name='phone', example='1887879****'),
  ramId?: string(name='ramId', example='1344383'),
  scene?: long(name='scene', example='USER_LIST'),
  synergyChannel?: string(name='synergyChannel', example='DINGDING'),
  username?: string(name='username', example='张三'),
}

model ListUsersResponseBody = {
  data?: [ 
    {
      accountType?: long(name='accountType', example='SUB'),
      appAccount?: string(name='appAccount', example='23456tre'),
      email?: string(name='email', example='2345****@qq.com'),
      gmtActive?: string(name='gmtActive'),
      gmtCreate?: string(name='gmtCreate'),
      isActive?: long(name='isActive'),
      isEditableUser?: long(name='isEditableUser', example='true'),
      isOperation?: int32(name='isOperation'),
      isRam?: int32(name='isRam'),
      isRelated?: string(name='isRelated', example='RELATED关联  NOT_RELATED 未关联'),
      phone?: string(name='phone', example='1390000****'),
      ramId?: long(name='ramId', example='53624523'),
      roleIdList?: [ long ](name='roleIdList'),
      roleNameList?: [ string ](name='roleNameList'),
      synergyChannel?: string(name='synergyChannel', example='DINGDING'),
      userId?: long(name='userId', example='1234'),
      username?: string(name='username'),
    }
  ](name='data', description='data'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  totalCount?: long(name='totalCount', example='100'),
}

model ListUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUsersResponseBody(name='body'),
}

/**
 * @summary 人员列表
 *
 * @param request ListUsersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUsersResponse
 */
async function listUsersWithOptions(request: ListUsersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListUsersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['pageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['pageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.phone)) {
    body['phone'] = request.phone;
  }
  if (!Util.isUnset(request.ramId)) {
    body['ramId'] = request.ramId;
  }
  if (!Util.isUnset(request.scene)) {
    body['scene'] = request.scene;
  }
  if (!Util.isUnset(request.synergyChannel)) {
    body['synergyChannel'] = request.synergyChannel;
  }
  if (!Util.isUnset(request.username)) {
    body['username'] = request.username;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListUsers',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/list`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 人员列表
 *
 * @param request ListUsersRequest
 * @return ListUsersResponse
 */
async function listUsers(request: ListUsersRequest): ListUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listUsersWithOptions(request, headers, runtime);
}

model PushMonitorRequest {
  body?: string(name='body'),
}

model PushMonitorResponseBody = {
  data?: any(name='data', example='null'),
  requestId?: string(name='requestId', example='5A30D240-1821-0246-B580-AB1468657AD2'),
}

model PushMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushMonitorResponseBody(name='body'),
}

/**
 * @summary 监控数据接入API
 *
 * @param request PushMonitorRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushMonitorResponse
 */
async function pushMonitorWithOptions(apiKey: string, request: PushMonitorRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PushMonitorResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = request.body,
  };
  var params = new OpenApi.Params{
    action = 'PushMonitor',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/api/monitor/push/${OpenApiUtil.getEncodeParam(apiKey)}`,
    method = 'POST',
    authType = 'Anonymous',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 监控数据接入API
 *
 * @param request PushMonitorRequest
 * @return PushMonitorResponse
 */
async function pushMonitor(apiKey: string, request: PushMonitorRequest): PushMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pushMonitorWithOptions(apiKey, request, headers, runtime);
}

model RecoverProblemRequest {
  problemId?: long(name='problemId', example='123'),
  problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_UPDATE'),
  recoveryTime?: string(name='recoveryTime', example='2020-02-01 00:00:00'),
}

model RecoverProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='EBC39DEF-C95B-46F8-9AE3-204F0B0A706D'),
}

model RecoverProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RecoverProblemResponseBody(name='body'),
}

/**
 * @summary 故障恢复
 *
 * @param request RecoverProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RecoverProblemResponse
 */
async function recoverProblemWithOptions(request: RecoverProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RecoverProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }
  if (!Util.isUnset(request.recoveryTime)) {
    body['recoveryTime'] = request.recoveryTime;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RecoverProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/recovery`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障恢复
 *
 * @param request RecoverProblemRequest
 * @return RecoverProblemResponse
 */
async function recoverProblem(request: RecoverProblemRequest): RecoverProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return recoverProblemWithOptions(request, headers, runtime);
}

model RefreshIntegrationConfigKeyRequest {
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  integrationConfigId?: long(name='integrationConfigId', example='102'),
}

model RefreshIntegrationConfigKeyResponseBody = {
  data?: {
    key?: string(name='key', example='859FA6A2-AC5C-4B09-BE23-986F887H6A232'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
}

model RefreshIntegrationConfigKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshIntegrationConfigKeyResponseBody(name='body'),
}

/**
 * @summary 刷新集成配置key
 *
 * @param request RefreshIntegrationConfigKeyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshIntegrationConfigKeyResponse
 */
async function refreshIntegrationConfigKeyWithOptions(request: RefreshIntegrationConfigKeyRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RefreshIntegrationConfigKeyResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RefreshIntegrationConfigKey',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/refreshKey`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 刷新集成配置key
 *
 * @param request RefreshIntegrationConfigKeyRequest
 * @return RefreshIntegrationConfigKeyResponse
 */
async function refreshIntegrationConfigKey(request: RefreshIntegrationConfigKeyRequest): RefreshIntegrationConfigKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return refreshIntegrationConfigKeyWithOptions(request, headers, runtime);
}

model RemoveIntegrationConfigRequest {
  clientToken?: string(name='clientToken'),
  integrationConfigId?: long(name='integrationConfigId'),
}

model RemoveIntegrationConfigResponseBody = {
  requestId?: string(name='requestId'),
}

model RemoveIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 解除集成配置
 *
 * @param request RemoveIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveIntegrationConfigResponse
 */
async function removeIntegrationConfigWithOptions(request: RemoveIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RemoveIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/remove`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解除集成配置
 *
 * @param request RemoveIntegrationConfigRequest
 * @return RemoveIntegrationConfigResponse
 */
async function removeIntegrationConfig(request: RemoveIntegrationConfigRequest): RemoveIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return removeIntegrationConfigWithOptions(request, headers, runtime);
}

model RemoveProblemServiceGroupRequest {
  problemId?: long(name='problemId', example='13123'),
  serviceGroupIds?: [ long ](name='serviceGroupIds'),
}

model RemoveProblemServiceGroupResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='5AD6E6BC-2582-4E0E-832D-52CB1B922253'),
}

model RemoveProblemServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveProblemServiceGroupResponseBody(name='body'),
}

/**
 * @summary 删除故障协同组
 *
 * @param request RemoveProblemServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveProblemServiceGroupResponse
 */
async function removeProblemServiceGroupWithOptions(request: RemoveProblemServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RemoveProblemServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.serviceGroupIds)) {
    body['serviceGroupIds'] = request.serviceGroupIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveProblemServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/removeServiceGroup`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除故障协同组
 *
 * @param request RemoveProblemServiceGroupRequest
 * @return RemoveProblemServiceGroupResponse
 */
async function removeProblemServiceGroup(request: RemoveProblemServiceGroupRequest): RemoveProblemServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return removeProblemServiceGroupWithOptions(request, headers, runtime);
}

model ReplayProblemRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3212'),
  problemId?: long(name='problemId', example='123'),
  replayDutyUserId?: long(name='replayDutyUserId', example='3123'),
}

model ReplayProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='B81E84B5-8FD1-45F3-969A-B5067AADCFFF'),
}

model ReplayProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReplayProblemResponseBody(name='body'),
}

/**
 * @summary 故障复盘
 *
 * @param request ReplayProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReplayProblemResponse
 */
async function replayProblemWithOptions(request: ReplayProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReplayProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.replayDutyUserId)) {
    body['replayDutyUserId'] = request.replayDutyUserId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReplayProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/replay`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障复盘
 *
 * @param request ReplayProblemRequest
 * @return ReplayProblemResponse
 */
async function replayProblem(request: ReplayProblemRequest): ReplayProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return replayProblemWithOptions(request, headers, runtime);
}

model RespondIncidentRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A221'),
  incidentIds?: [ long ](name='incidentIds', description='影响程度'),
}

model RespondIncidentResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='062E6568-E505-49D6-8DD0-8F11283EB0AB'),
}

model RespondIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RespondIncidentResponseBody(name='body'),
}

/**
 * @summary 事件响应
 *
 * @param request RespondIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RespondIncidentResponse
 */
async function respondIncidentWithOptions(request: RespondIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RespondIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.incidentIds)) {
    body['incidentIds'] = request.incidentIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RespondIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/response`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 事件响应
 *
 * @param request RespondIncidentRequest
 * @return RespondIncidentResponse
 */
async function respondIncident(request: RespondIncidentRequest): RespondIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return respondIncidentWithOptions(request, headers, runtime);
}

model RevokeProblemRecoveryRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2EF'),
  problemId?: long(name='problemId', example='1231'),
  problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_UPGRADE'),
}

model RevokeProblemRecoveryResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model RevokeProblemRecoveryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevokeProblemRecoveryResponseBody(name='body'),
}

/**
 * @summary 故障撤销恢复
 *
 * @param request RevokeProblemRecoveryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevokeProblemRecoveryResponse
 */
async function revokeProblemRecoveryWithOptions(request: RevokeProblemRecoveryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): RevokeProblemRecoveryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RevokeProblemRecovery',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/revoke`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 故障撤销恢复
 *
 * @param request RevokeProblemRecoveryRequest
 * @return RevokeProblemRecoveryResponse
 */
async function revokeProblemRecovery(request: RevokeProblemRecoveryRequest): RevokeProblemRecoveryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return revokeProblemRecoveryWithOptions(request, headers, runtime);
}

model UnbindUserResponseBody = {
  requestId?: string(name='requestId'),
}

model UnbindUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindUserResponseBody(name='body'),
}

/**
 * @summary 解绑用户
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindUserResponse
 */
async function unbindUserWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): UnbindUserResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'UnbindUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/unbind`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解绑用户
 *
 * @return UnbindUserResponse
 */
async function unbindUser(): UnbindUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return unbindUserWithOptions(headers, runtime);
}

model UpdateEscalationPlanRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='6b404f14-77d1-4b53-a1a1-30a58bbcfc57'),
  escalationPlanDescription?: string(name='escalationPlanDescription', example='xxxx'),
  escalationPlanId?: long(name='escalationPlanId', description='This parameter is required.', example='433'),
  escalationPlanName?: string(name='escalationPlanName', example='xxx'),
  escalationPlanRules?: [ 
    {
      escalationPlanConditions?: [ 
        {
          effection?: string(name='effection', description='LOW HIGH', example='LOW'),
          level?: string(name='level', description='P1 P2 P3 P4', example='P1'),
        }
      ](name='escalationPlanConditions'),
      escalationPlanStrategies?: [ 
        {
          enableWebhook?: boolean(name='enableWebhook', example='true'),
          escalationPlanType?: string(name='escalationPlanType', example='UN_ACKNOWLEDGE'),
          noticeChannels?: [ string ](name='noticeChannels'),
          noticeObjects?: [ long ](name='noticeObjects'),
          noticeRoleList?: [ long ](name='noticeRoleList'),
          noticeTime?: long(name='noticeTime', example='30'),
          serviceGroupIds?: [ long ](name='serviceGroupIds'),
        }
      ](name='escalationPlanStrategies'),
      escalationPlanType?: string(name='escalationPlanType', example='UN_ACKNOWLEDGE'),
      id?: long(name='id', example='872'),
    }
  ](name='escalationPlanRules'),
  escalationPlanScopeObjects?: [ 
    {
      id?: long(name='id', description='This parameter is required.', example='87'),
      scope?: string(name='scope', example='SERVICE'),
      scopeObjectId?: long(name='scopeObjectId', description='This parameter is required.', example='234'),
    }
  ](name='escalationPlanScopeObjects'),
  isGlobal?: boolean(name='isGlobal'),
}

model UpdateEscalationPlanResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='A5A1FEAE-9C47-011C-9C73-A376BC2REQUEST'),
}

model UpdateEscalationPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEscalationPlanResponseBody(name='body'),
}

/**
 * @summary 更新升级计划
 *
 * @param request UpdateEscalationPlanRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEscalationPlanResponse
 */
async function updateEscalationPlanWithOptions(request: UpdateEscalationPlanRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEscalationPlanResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanDescription)) {
    body['escalationPlanDescription'] = request.escalationPlanDescription;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }
  if (!Util.isUnset(request.escalationPlanName)) {
    body['escalationPlanName'] = request.escalationPlanName;
  }
  if (!Util.isUnset(request.escalationPlanRules)) {
    body['escalationPlanRules'] = request.escalationPlanRules;
  }
  if (!Util.isUnset(request.escalationPlanScopeObjects)) {
    body['escalationPlanScopeObjects'] = request.escalationPlanScopeObjects;
  }
  if (!Util.isUnset(request.isGlobal)) {
    body['isGlobal'] = request.isGlobal;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEscalationPlan',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/escalationPlan/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新升级计划
 *
 * @param request UpdateEscalationPlanRequest
 * @return UpdateEscalationPlanResponse
 */
async function updateEscalationPlan(request: UpdateEscalationPlanRequest): UpdateEscalationPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEscalationPlanWithOptions(request, headers, runtime);
}

model UpdateIncidentRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A123'),
  effect?: string(name='effect', example='LOW'),
  incidentId?: long(name='incidentId', description='This parameter is required.', example='12312'),
  incidentLevel?: string(name='incidentLevel', example='P1'),
  incidentTitle?: string(name='incidentTitle', example='事件标题'),
}

model UpdateIncidentResponseBody = {
  data?: {
    incidentId?: long(name='incidentId', example='2312'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model UpdateIncidentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIncidentResponseBody(name='body'),
}

/**
 * @summary 更新事件详情
 *
 * @param request UpdateIncidentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIncidentResponse
 */
async function updateIncidentWithOptions(request: UpdateIncidentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateIncidentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.effect)) {
    body['effect'] = request.effect;
  }
  if (!Util.isUnset(request.incidentId)) {
    body['incidentId'] = request.incidentId;
  }
  if (!Util.isUnset(request.incidentLevel)) {
    body['incidentLevel'] = request.incidentLevel;
  }
  if (!Util.isUnset(request.incidentTitle)) {
    body['incidentTitle'] = request.incidentTitle;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIncident',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/incident/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新事件详情
 *
 * @param request UpdateIncidentRequest
 * @return UpdateIncidentResponse
 */
async function updateIncident(request: UpdateIncidentRequest): UpdateIncidentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateIncidentWithOptions(request, headers, runtime);
}

model UpdateIntegrationConfigRequest {
  accessKey?: string(name='accessKey', description='accessKey', example='601FA6A2-AC5C-4B59-BE11-378F887A6A11'),
  clientToken?: string(name='clientToken', example='601FA6A2-AC5C-4B59-BE11-378F987A6A98'),
  integrationConfigId?: long(name='integrationConfigId', example='103'),
}

model UpdateIntegrationConfigResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='10REQUES-AC5C-4B59-BE11-378F117A6A88'),
}

model UpdateIntegrationConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIntegrationConfigResponseBody(name='body'),
}

/**
 * @summary 更新集成配置
 *
 * @param request UpdateIntegrationConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIntegrationConfigResponse
 */
async function updateIntegrationConfigWithOptions(request: UpdateIntegrationConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateIntegrationConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.accessKey)) {
    body['accessKey'] = request.accessKey;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.integrationConfigId)) {
    body['integrationConfigId'] = request.integrationConfigId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIntegrationConfig',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/integrationConfig/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新集成配置
 *
 * @param request UpdateIntegrationConfigRequest
 * @return UpdateIntegrationConfigResponse
 */
async function updateIntegrationConfig(request: UpdateIntegrationConfigRequest): UpdateIntegrationConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateIntegrationConfigWithOptions(request, headers, runtime);
}

model UpdateProblemRequest {
  feedback?: string(name='feedback'),
  level?: string(name='level', example='P1'),
  mainHandlerId?: long(name='mainHandlerId', example='678'),
  preliminaryReason?: string(name='preliminaryReason'),
  problemId?: long(name='problemId', example='213432'),
  problemName?: string(name='problemName'),
  progressSummary?: string(name='progressSummary'),
  progressSummaryRichTextId?: long(name='progressSummaryRichTextId', example='23232'),
  relatedServiceId?: long(name='relatedServiceId', example='123'),
  serviceGroupIds?: [ long ](name='serviceGroupIds'),
}

model UpdateProblemResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model UpdateProblemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemResponseBody(name='body'),
}

/**
 * @summary 更新故障
 *
 * @param request UpdateProblemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemResponse
 */
async function updateProblemWithOptions(request: UpdateProblemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.feedback)) {
    body['feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.level)) {
    body['level'] = request.level;
  }
  if (!Util.isUnset(request.mainHandlerId)) {
    body['mainHandlerId'] = request.mainHandlerId;
  }
  if (!Util.isUnset(request.preliminaryReason)) {
    body['preliminaryReason'] = request.preliminaryReason;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemName)) {
    body['problemName'] = request.problemName;
  }
  if (!Util.isUnset(request.progressSummary)) {
    body['progressSummary'] = request.progressSummary;
  }
  if (!Util.isUnset(request.progressSummaryRichTextId)) {
    body['progressSummaryRichTextId'] = request.progressSummaryRichTextId;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.serviceGroupIds)) {
    body['serviceGroupIds'] = request.serviceGroupIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblem',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新故障
 *
 * @param request UpdateProblemRequest
 * @return UpdateProblemResponse
 */
async function updateProblem(request: UpdateProblemRequest): UpdateProblemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemWithOptions(request, headers, runtime);
}

model UpdateProblemEffectionServiceRequest {
  clientToken?: string(name='clientToken', description='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  description?: string(name='description', example='乐嘉国际大厦'),
  effectionServiceId?: long(name='effectionServiceId', example='103'),
  level?: string(name='level', example='P1'),
  picUrl?: [ string ](name='picUrl'),
  problemId?: long(name='problemId', example='190000000'),
  serviceId?: long(name='serviceId', example='33'),
  status?: string(name='status', example='UN_RECOVERED'),
}

model UpdateProblemEffectionServiceResponseBody = {
  requestId?: string(name='requestId', description='requestId', example='ffbf594-e093-46ad-bdcd-df4d7097125a'),
}

model UpdateProblemEffectionServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemEffectionServiceResponseBody(name='body'),
}

/**
 * @summary 更新故障影响服务
 *
 * @param request UpdateProblemEffectionServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemEffectionServiceResponse
 */
async function updateProblemEffectionServiceWithOptions(request: UpdateProblemEffectionServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemEffectionServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.description)) {
    body['description'] = request.description;
  }
  if (!Util.isUnset(request.effectionServiceId)) {
    body['effectionServiceId'] = request.effectionServiceId;
  }
  if (!Util.isUnset(request.level)) {
    body['level'] = request.level;
  }
  if (!Util.isUnset(request.picUrl)) {
    body['picUrl'] = request.picUrl;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblemEffectionService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/effectionService/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新故障影响服务
 *
 * @param request UpdateProblemEffectionServiceRequest
 * @return UpdateProblemEffectionServiceResponse
 */
async function updateProblemEffectionService(request: UpdateProblemEffectionServiceRequest): UpdateProblemEffectionServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemEffectionServiceWithOptions(request, headers, runtime);
}

model UpdateProblemImprovementRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3813'),
  customProblemReason?: string(name='customProblemReason'),
  discoverSource?: long(name='discoverSource', example='1'),
  dutyDepartmentId?: long(name='dutyDepartmentId', example='123123'),
  dutyDepartmentName?: string(name='dutyDepartmentName'),
  dutyUserId?: long(name='dutyUserId', example='1231'),
  injectionMode?: string(name='injectionMode', example='1'),
  monitorSourceName?: string(name='monitorSourceName', example='Zabbix'),
  problemId?: long(name='problemId', example='12312'),
  problemReason?: string(name='problemReason'),
  recentActivity?: string(name='recentActivity', example='2'),
  recoveryMode?: string(name='recoveryMode', example='2'),
  relationChanges?: string(name='relationChanges'),
  remark?: string(name='remark'),
  replayDutyUserId?: long(name='replayDutyUserId', example='1213'),
  userReport?: long(name='userReport', example='10'),
}

model UpdateProblemImprovementResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model UpdateProblemImprovementResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemImprovementResponseBody(name='body'),
}

/**
 * @summary 改进分析更新
 *
 * @param request UpdateProblemImprovementRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemImprovementResponse
 */
async function updateProblemImprovementWithOptions(request: UpdateProblemImprovementRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemImprovementResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.customProblemReason)) {
    body['customProblemReason'] = request.customProblemReason;
  }
  if (!Util.isUnset(request.discoverSource)) {
    body['discoverSource'] = request.discoverSource;
  }
  if (!Util.isUnset(request.dutyDepartmentId)) {
    body['dutyDepartmentId'] = request.dutyDepartmentId;
  }
  if (!Util.isUnset(request.dutyDepartmentName)) {
    body['dutyDepartmentName'] = request.dutyDepartmentName;
  }
  if (!Util.isUnset(request.dutyUserId)) {
    body['dutyUserId'] = request.dutyUserId;
  }
  if (!Util.isUnset(request.injectionMode)) {
    body['injectionMode'] = request.injectionMode;
  }
  if (!Util.isUnset(request.monitorSourceName)) {
    body['monitorSourceName'] = request.monitorSourceName;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemReason)) {
    body['problemReason'] = request.problemReason;
  }
  if (!Util.isUnset(request.recentActivity)) {
    body['recentActivity'] = request.recentActivity;
  }
  if (!Util.isUnset(request.recoveryMode)) {
    body['recoveryMode'] = request.recoveryMode;
  }
  if (!Util.isUnset(request.relationChanges)) {
    body['relationChanges'] = request.relationChanges;
  }
  if (!Util.isUnset(request.remark)) {
    body['remark'] = request.remark;
  }
  if (!Util.isUnset(request.replayDutyUserId)) {
    body['replayDutyUserId'] = request.replayDutyUserId;
  }
  if (!Util.isUnset(request.userReport)) {
    body['userReport'] = request.userReport;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblemImprovement',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/improvement/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改进分析更新
 *
 * @param request UpdateProblemImprovementRequest
 * @return UpdateProblemImprovementResponse
 */
async function updateProblemImprovement(request: UpdateProblemImprovementRequest): UpdateProblemImprovementResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemImprovementWithOptions(request, headers, runtime);
}

model UpdateProblemMeasureRequest {
  checkStandard?: string(name='checkStandard', example='2'),
  checkUserId?: long(name='checkUserId', example='123'),
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  content?: string(name='content'),
  directorId?: long(name='directorId', example='123'),
  measureId?: long(name='measureId', example='1231'),
  planFinishTime?: string(name='planFinishTime', example='2021-01-21 00:00:00'),
  problemId?: long(name='problemId', example='1233'),
  stalkerId?: long(name='stalkerId', example='123'),
  status?: string(name='status', example='UNIMPROVED'),
  type?: int32(name='type', example='3'),
}

model UpdateProblemMeasureResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model UpdateProblemMeasureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemMeasureResponseBody(name='body'),
}

/**
 * @summary 改进措施更新
 *
 * @param request UpdateProblemMeasureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemMeasureResponse
 */
async function updateProblemMeasureWithOptions(request: UpdateProblemMeasureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemMeasureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.checkStandard)) {
    body['checkStandard'] = request.checkStandard;
  }
  if (!Util.isUnset(request.checkUserId)) {
    body['checkUserId'] = request.checkUserId;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.directorId)) {
    body['directorId'] = request.directorId;
  }
  if (!Util.isUnset(request.measureId)) {
    body['measureId'] = request.measureId;
  }
  if (!Util.isUnset(request.planFinishTime)) {
    body['planFinishTime'] = request.planFinishTime;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.stalkerId)) {
    body['stalkerId'] = request.stalkerId;
  }
  if (!Util.isUnset(request.status)) {
    body['status'] = request.status;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblemMeasure',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/improvement/measure/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改进措施更新
 *
 * @param request UpdateProblemMeasureRequest
 * @return UpdateProblemMeasureResponse
 */
async function updateProblemMeasure(request: UpdateProblemMeasureRequest): UpdateProblemMeasureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemMeasureWithOptions(request, headers, runtime);
}

model UpdateProblemNoticeRequest {
  clientToken?: string(name='clientToken', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
  problemId?: long(name='problemId', example='1312'),
  problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_NOTIFY'),
}

model UpdateProblemNoticeResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='4361a0e1-6747-4834-96ce-0c4840fd3812'),
}

model UpdateProblemNoticeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemNoticeResponseBody(name='body'),
}

/**
 * @summary 更新故障通知
 *
 * @param request UpdateProblemNoticeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemNoticeResponse
 */
async function updateProblemNoticeWithOptions(request: UpdateProblemNoticeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemNoticeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemNotifyType)) {
    body['problemNotifyType'] = request.problemNotifyType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblemNotice',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/notify`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新故障通知
 *
 * @param request UpdateProblemNoticeRequest
 * @return UpdateProblemNoticeResponse
 */
async function updateProblemNotice(request: UpdateProblemNoticeRequest): UpdateProblemNoticeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemNoticeWithOptions(request, headers, runtime);
}

model UpdateProblemTimelineRequest {
  clientToken?: string(name='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  content?: string(name='content'),
  keyNode?: string(name='keyNode', example='NodeTest'),
  problemId?: long(name='problemId', example='234'),
  problemTimelineId?: long(name='problemTimelineId', example='3940'),
  time?: string(name='time', example='2021-01-08 10:10:10'),
}

model UpdateProblemTimelineResponseBody = {
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model UpdateProblemTimelineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProblemTimelineResponseBody(name='body'),
}

/**
 * @summary 更新故障时间线节点
 *
 * @param request UpdateProblemTimelineRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProblemTimelineResponse
 */
async function updateProblemTimelineWithOptions(request: UpdateProblemTimelineRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProblemTimelineResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.content)) {
    body['content'] = request.content;
  }
  if (!Util.isUnset(request.keyNode)) {
    body['keyNode'] = request.keyNode;
  }
  if (!Util.isUnset(request.problemId)) {
    body['problemId'] = request.problemId;
  }
  if (!Util.isUnset(request.problemTimelineId)) {
    body['problemTimelineId'] = request.problemTimelineId;
  }
  if (!Util.isUnset(request.time)) {
    body['time'] = request.time;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProblemTimeline',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/problem/process/timeline/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新故障时间线节点
 *
 * @param request UpdateProblemTimelineRequest
 * @return UpdateProblemTimelineResponse
 */
async function updateProblemTimeline(request: UpdateProblemTimelineRequest): UpdateProblemTimelineResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProblemTimelineWithOptions(request, headers, runtime);
}

model UpdateRichTextRequest {
  instanceId?: long(name='instanceId', example='123123'),
  instanceType?: string(name='instanceType', example='INCIDENT 事件 ALERT告警 PROBLEM故障'),
  richText?: string(name='richText', example='这是一个富文本'),
  richTextId?: long(name='richTextId', example='123112313'),
}

model UpdateRichTextResponseBody = {
  data?: {
    id?: long(name='id', example='12'),
  }(name='data', description='data'),
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model UpdateRichTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRichTextResponseBody(name='body'),
}

/**
 * @summary 更新富文本
 *
 * @param request UpdateRichTextRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRichTextResponse
 */
async function updateRichTextWithOptions(request: UpdateRichTextRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateRichTextResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['instanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.instanceType)) {
    body['instanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.richText)) {
    body['richText'] = request.richText;
  }
  if (!Util.isUnset(request.richTextId)) {
    body['richTextId'] = request.richTextId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRichText',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/rich/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新富文本
 *
 * @param request UpdateRichTextRequest
 * @return UpdateRichTextResponse
 */
async function updateRichText(request: UpdateRichTextRequest): UpdateRichTextResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRichTextWithOptions(request, headers, runtime);
}

model UpdateRouteRuleRequest {
  assignObjectId?: long(name='assignObjectId', description='This parameter is required.', example='1'),
  assignObjectType?: string(name='assignObjectType', description='This parameter is required.', example='SERVICEGROUP'),
  childRuleRelation?: string(name='childRuleRelation', example='AND'),
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  convergenceFields?: [ string ](name='convergenceFields'),
  convergenceType?: int32(name='convergenceType'),
  coverageProblemLevels?: [ string ](name='coverageProblemLevels'),
  effection?: string(name='effection', description='This parameter is required.', example='LOW'),
  incidentLevel?: string(name='incidentLevel', description='This parameter is required.', example='P1'),
  matchCount?: long(name='matchCount', description='This parameter is required.', example='10'),
  notifyChannels?: [ string ](name='notifyChannels', description='This parameter is required.'),
  problemEffectionServices?: [ long ](name='problemEffectionServices'),
  problemLevelGroup?: map[string]ProblemLevelGroupValue(name='problemLevelGroup'),
  relatedServiceId?: long(name='relatedServiceId', description='This parameter is required.', example='1'),
  routeChildRules?: [ 
    {
      childConditionRelation?: long(name='childConditionRelation', example='1'),
      childRouteRuleId?: long(name='childRouteRuleId', description='This parameter is required.', example='1'),
      conditions?: [ 
        {
          key?: string(name='key', description='This parameter is required.', example='payload.summary'),
          operationSymbol?: string(name='operationSymbol', description='This parameter is required.', example='equals'),
          value?: string(name='value', description='This parameter is required.', example='123'),
        }
      ](name='conditions', description='This parameter is required.'),
      isValidChildRule?: boolean(name='isValidChildRule', description='This parameter is required.', example='false'),
      monitorSourceId?: long(name='monitorSourceId', description='This parameter is required.', example='1'),
      problemLevel?: string(name='problemLevel'),
    }
  ](name='routeChildRules', description='This parameter is required.'),
  routeRuleId?: long(name='routeRuleId', description='This parameter is required.', example='1'),
  routeType?: string(name='routeType', description='This parameter is required.', example='ALERT'),
  ruleName?: string(name='ruleName', description='This parameter is required.', example='规则1'),
  timeWindow?: int32(name='timeWindow', description='This parameter is required.', example='10'),
  timeWindowUnit?: string(name='timeWindowUnit', description='This parameter is required.', example='MINUTE'),
}

model UpdateRouteRuleResponseBody = {
  data?: long(name='data', example='null'),
  requestId?: string(name='requestId', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model UpdateRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRouteRuleResponseBody(name='body'),
}

/**
 * @summary 更新流转规则
 *
 * @param request UpdateRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRouteRuleResponse
 */
async function updateRouteRuleWithOptions(request: UpdateRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.assignObjectId)) {
    body['assignObjectId'] = request.assignObjectId;
  }
  if (!Util.isUnset(request.assignObjectType)) {
    body['assignObjectType'] = request.assignObjectType;
  }
  if (!Util.isUnset(request.childRuleRelation)) {
    body['childRuleRelation'] = request.childRuleRelation;
  }
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.convergenceFields)) {
    body['convergenceFields'] = request.convergenceFields;
  }
  if (!Util.isUnset(request.convergenceType)) {
    body['convergenceType'] = request.convergenceType;
  }
  if (!Util.isUnset(request.coverageProblemLevels)) {
    body['coverageProblemLevels'] = request.coverageProblemLevels;
  }
  if (!Util.isUnset(request.effection)) {
    body['effection'] = request.effection;
  }
  if (!Util.isUnset(request.incidentLevel)) {
    body['incidentLevel'] = request.incidentLevel;
  }
  if (!Util.isUnset(request.matchCount)) {
    body['matchCount'] = request.matchCount;
  }
  if (!Util.isUnset(request.notifyChannels)) {
    body['notifyChannels'] = request.notifyChannels;
  }
  if (!Util.isUnset(request.problemEffectionServices)) {
    body['problemEffectionServices'] = request.problemEffectionServices;
  }
  if (!Util.isUnset(request.problemLevelGroup)) {
    body['problemLevelGroup'] = request.problemLevelGroup;
  }
  if (!Util.isUnset(request.relatedServiceId)) {
    body['relatedServiceId'] = request.relatedServiceId;
  }
  if (!Util.isUnset(request.routeChildRules)) {
    body['routeChildRules'] = request.routeChildRules;
  }
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }
  if (!Util.isUnset(request.routeType)) {
    body['routeType'] = request.routeType;
  }
  if (!Util.isUnset(request.ruleName)) {
    body['ruleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.timeWindow)) {
    body['timeWindow'] = request.timeWindow;
  }
  if (!Util.isUnset(request.timeWindowUnit)) {
    body['timeWindowUnit'] = request.timeWindowUnit;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/edit`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新流转规则
 *
 * @param request UpdateRouteRuleRequest
 * @return UpdateRouteRuleResponse
 */
async function updateRouteRule(request: UpdateRouteRuleRequest): UpdateRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRouteRuleWithOptions(request, headers, runtime);
}

model UpdateServiceRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  escalationPlanId?: long(name='escalationPlanId'),
  serviceDescription?: string(name='serviceDescription', example='服务描述'),
  serviceGroupIdList?: [ long ](name='serviceGroupIdList'),
  serviceId?: long(name='serviceId', example='10002000'),
  serviceName?: string(name='serviceName', example='服务名字'),
}

model UpdateServiceResponseBody = {
  data?: long(name='data', example='null'),
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model UpdateServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceResponseBody(name='body'),
}

/**
 * @summary 更新服务
 *
 * @param request UpdateServiceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceResponse
 */
async function updateServiceWithOptions(request: UpdateServiceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateServiceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.escalationPlanId)) {
    body['escalationPlanId'] = request.escalationPlanId;
  }
  if (!Util.isUnset(request.serviceDescription)) {
    body['serviceDescription'] = request.serviceDescription;
  }
  if (!Util.isUnset(request.serviceGroupIdList)) {
    body['serviceGroupIdList'] = request.serviceGroupIdList;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['serviceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['serviceName'] = request.serviceName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateService',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新服务
 *
 * @param request UpdateServiceRequest
 * @return UpdateServiceResponse
 */
async function updateService(request: UpdateServiceRequest): UpdateServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateServiceWithOptions(request, headers, runtime);
}

model UpdateServiceGroupRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  enableWebhook?: string(name='enableWebhook', description='This parameter is required.', example='ENABLE'),
  monitorSourceTemplates?: [ 
    {
      monitorSourceId?: long(name='monitorSourceId', example='11111'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
      templateContent?: string(name='templateContent', example='xxxx'),
      templateId?: long(name='templateId', example='1111'),
    }
  ](name='monitorSourceTemplates'),
  serviceGroupDescription?: string(name='serviceGroupDescription', example='飞车'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='1'),
  serviceGroupName?: string(name='serviceGroupName', description='This parameter is required.', example='冲上云霄'),
  userIds?: [ long ](name='userIds', description='This parameter is required.'),
  webhookLink?: string(name='webhookLink', description='This parameter is required.', example='wwwwwww'),
  webhookType?: string(name='webhookType', description='This parameter is required.', example='WEIXINGROUP'),
}

model UpdateServiceGroupResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
}

model UpdateServiceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceGroupResponseBody(name='body'),
}

/**
 * @summary 更新服务组
 *
 * @param request UpdateServiceGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceGroupResponse
 */
async function updateServiceGroupWithOptions(request: UpdateServiceGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateServiceGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enableWebhook)) {
    body['enableWebhook'] = request.enableWebhook;
  }
  if (!Util.isUnset(request.monitorSourceTemplates)) {
    body['monitorSourceTemplates'] = request.monitorSourceTemplates;
  }
  if (!Util.isUnset(request.serviceGroupDescription)) {
    body['serviceGroupDescription'] = request.serviceGroupDescription;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }
  if (!Util.isUnset(request.serviceGroupName)) {
    body['serviceGroupName'] = request.serviceGroupName;
  }
  if (!Util.isUnset(request.userIds)) {
    body['userIds'] = request.userIds;
  }
  if (!Util.isUnset(request.webhookLink)) {
    body['webhookLink'] = request.webhookLink;
  }
  if (!Util.isUnset(request.webhookType)) {
    body['webhookType'] = request.webhookType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceGroup',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/modify`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新服务组
 *
 * @param request UpdateServiceGroupRequest
 * @return UpdateServiceGroupResponse
 */
async function updateServiceGroup(request: UpdateServiceGroupRequest): UpdateServiceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateServiceGroupWithOptions(request, headers, runtime);
}

model UpdateServiceGroupSchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  fastScheduling?: {
    dutyPlan?: string(name='dutyPlan', example='FAST_CHOICE'),
    id?: long(name='id', example='1'),
    schedulingUsers?: [ 
      {
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: int32(name='schedulingOrder', example='1'),
        schedulingUserId?: long(name='schedulingUserId', example='6666'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
      }
    ](name='schedulingUsers'),
    singleDuration?: int32(name='singleDuration', example='12'),
    singleDurationUnit?: string(name='singleDurationUnit', example='DAY'),
  }(name='fastScheduling', example='HOUR'),
  fineScheduling?: {
    id?: long(name='id', example='1'),
    period?: int32(name='period', example='1'),
    periodUnit?: string(name='periodUnit', example='DAY'),
    schedulingFineShifts?: [ 
      {
        cycleOrder?: int32(name='cycleOrder', example='123'),
        schedulingEndTime?: string(name='schedulingEndTime', example='2020-10-13'),
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: long(name='schedulingOrder', example='1'),
        schedulingStartTime?: string(name='schedulingStartTime', example='2020-08-13'),
        schedulingUserId?: long(name='schedulingUserId', example='32'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
        shiftName?: string(name='shiftName', example='早班'),
        skipOneDay?: boolean(name='skipOneDay', example='true'),
      }
    ](name='schedulingFineShifts'),
    schedulingTemplateFineShifts?: [ 
      {
        schedulingEndTime?: string(name='schedulingEndTime', example='2021-11-01 00:00：00'),
        schedulingObjectType?: string(name='schedulingObjectType'),
        schedulingOrder?: int32(name='schedulingOrder', example='1'),
        schedulingStartTime?: string(name='schedulingStartTime', example='2021-10-01 00:00：00'),
        schedulingUserId?: long(name='schedulingUserId', example='1'),
        schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
        shiftName?: string(name='shiftName'),
        skipOneDay?: boolean(name='skipOneDay', example='false'),
      }
    ](name='schedulingTemplateFineShifts'),
    shiftType?: string(name='shiftType', example='MORNING_NIGHT'),
  }(name='fineScheduling'),
  schedulingWay?: string(name='schedulingWay', description='This parameter is required.', example='FAST'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='1000'),
}

model UpdateServiceGroupSchedulingResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxxxxx'),
}

model UpdateServiceGroupSchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceGroupSchedulingResponseBody(name='body'),
}

/**
 * @summary 修改服务组排班
 *
 * @param request UpdateServiceGroupSchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceGroupSchedulingResponse
 */
async function updateServiceGroupSchedulingWithOptions(request: UpdateServiceGroupSchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateServiceGroupSchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.fastScheduling)) {
    body['fastScheduling'] = request.fastScheduling;
  }
  if (!Util.isUnset(request.fineScheduling)) {
    body['fineScheduling'] = request.fineScheduling;
  }
  if (!Util.isUnset(request.schedulingWay)) {
    body['schedulingWay'] = request.schedulingWay;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceGroupScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改服务组排班
 *
 * @param request UpdateServiceGroupSchedulingRequest
 * @return UpdateServiceGroupSchedulingResponse
 */
async function updateServiceGroupScheduling(request: UpdateServiceGroupSchedulingRequest): UpdateServiceGroupSchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateServiceGroupSchedulingWithOptions(request, headers, runtime);
}

model UpdateServiceGroupSpecialDaySchedulingRequest {
  clientToken?: string(name='clientToken', example='C4BE3837-1A13-413B-A225-2C88188E8A43'),
  schedulingDate?: string(name='schedulingDate', description='This parameter is required.', example='2021-08-19'),
  schedulingSpecialDays?: [ 
    {
      schedulingEndTime?: string(name='schedulingEndTime', description='This parameter is required.', example='2021-08-19 12:00:00'),
      schedulingObjectType?: string(name='schedulingObjectType'),
      schedulingOrder?: int32(name='schedulingOrder', example='1'),
      schedulingStartTime?: string(name='schedulingStartTime', description='This parameter is required.', example='2021-08-19 08:00:00'),
      schedulingUserId?: long(name='schedulingUserId', description='This parameter is required.', example='64'),
      schedulingUserIdList?: [ long ](name='schedulingUserIdList'),
    }
  ](name='schedulingSpecialDays', description='This parameter is required.'),
  serviceGroupId?: long(name='serviceGroupId', description='This parameter is required.', example='6666'),
}

model UpdateServiceGroupSpecialDaySchedulingResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxxxx'),
}

model UpdateServiceGroupSpecialDaySchedulingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServiceGroupSpecialDaySchedulingResponseBody(name='body'),
}

/**
 * @summary 修改指定日期的服务组排班
 *
 * @param request UpdateServiceGroupSpecialDaySchedulingRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServiceGroupSpecialDaySchedulingResponse
 */
async function updateServiceGroupSpecialDaySchedulingWithOptions(request: UpdateServiceGroupSpecialDaySchedulingRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateServiceGroupSpecialDaySchedulingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.schedulingDate)) {
    body['schedulingDate'] = request.schedulingDate;
  }
  if (!Util.isUnset(request.schedulingSpecialDays)) {
    body['schedulingSpecialDays'] = request.schedulingSpecialDays;
  }
  if (!Util.isUnset(request.serviceGroupId)) {
    body['serviceGroupId'] = request.serviceGroupId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateServiceGroupSpecialDayScheduling',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/services/group/scheduling/updateSpecialDayScheduling`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改指定日期的服务组排班
 *
 * @param request UpdateServiceGroupSpecialDaySchedulingRequest
 * @return UpdateServiceGroupSpecialDaySchedulingResponse
 */
async function updateServiceGroupSpecialDayScheduling(request: UpdateServiceGroupSpecialDaySchedulingRequest): UpdateServiceGroupSpecialDaySchedulingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateServiceGroupSpecialDaySchedulingWithOptions(request, headers, runtime);
}

model UpdateSubscriptionRequest {
  endTime?: string(name='endTime', example='2022-05-09 10:10:23'),
  expiredType?: string(name='expiredType', description='This parameter is required.', example='LONG_TERM'),
  notifyObjectList?: [ 
    {
      id?: long(name='id', example='10'),
      notifyObjectId?: long(name='notifyObjectId', description='This parameter is required.', example='19'),
    }
  ](name='notifyObjectList', description='This parameter is required.'),
  notifyObjectType?: string(name='notifyObjectType', description='This parameter is required.', example='USER'),
  notifyStrategyList?: [ 
    {
      instanceType?: long(name='instanceType', description='This parameter is required.', example='INCIDENT'),
      strategies?: [ 
        {
          channels?: string(name='channels', example='SMS,WEIXIN_GROUP'),
          conditions?: [ 
            {
              action?: string(name='action', example='INCIDENT_TRIGGER'),
              effection?: string(name='effection', example='HIGH'),
              level?: string(name='level', example='P1'),
              problemNotifyType?: string(name='problemNotifyType', example='PROBLEM_NOTIFY'),
            }
          ](name='conditions'),
          id?: string(name='id', example='10'),
          periodChannel?: {
            nonWorkday?: string(name='nonWorkday', example='SMS,WEIXIN_GROUP'),
            workday?: string(name='workday', example='SMS,WEIXIN_GROUP'),
          }(name='periodChannel'),
        }
      ](name='strategies', description='This parameter is required.'),
    }
  ](name='notifyStrategyList', description='This parameter is required.'),
  period?: string(name='period', example='1个月'),
  scope?: string(name='scope', description='This parameter is required.', example='SERVICE'),
  scopeObjectList?: [ 
    {
      id?: long(name='id', example='1'),
      scopeObjectId?: long(name='scopeObjectId', description='This parameter is required.', example='1'),
    }
  ](name='scopeObjectList', description='This parameter is required.'),
  startTime?: string(name='startTime', example='2021-04-04 10:10:11'),
  subscriptionId?: long(name='subscriptionId', description='This parameter is required.', example='80002020'),
  subscriptionTitle?: string(name='subscriptionTitle', description='This parameter is required.', example='newSubs244'),
}

model UpdateSubscriptionResponseBody = {
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model UpdateSubscriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSubscriptionResponseBody(name='body'),
}

/**
 * @summary 更新通知订阅
 *
 * @param request UpdateSubscriptionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSubscriptionResponse
 */
async function updateSubscriptionWithOptions(request: UpdateSubscriptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSubscriptionResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['endTime'] = request.endTime;
  }
  if (!Util.isUnset(request.expiredType)) {
    body['expiredType'] = request.expiredType;
  }
  if (!Util.isUnset(request.notifyObjectList)) {
    body['notifyObjectList'] = request.notifyObjectList;
  }
  if (!Util.isUnset(request.notifyObjectType)) {
    body['notifyObjectType'] = request.notifyObjectType;
  }
  if (!Util.isUnset(request.notifyStrategyList)) {
    body['notifyStrategyList'] = request.notifyStrategyList;
  }
  if (!Util.isUnset(request.period)) {
    body['period'] = request.period;
  }
  if (!Util.isUnset(request.scope)) {
    body['scope'] = request.scope;
  }
  if (!Util.isUnset(request.scopeObjectList)) {
    body['scopeObjectList'] = request.scopeObjectList;
  }
  if (!Util.isUnset(request.startTime)) {
    body['startTime'] = request.startTime;
  }
  if (!Util.isUnset(request.subscriptionId)) {
    body['subscriptionId'] = request.subscriptionId;
  }
  if (!Util.isUnset(request.subscriptionTitle)) {
    body['subscriptionTitle'] = request.subscriptionTitle;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSubscription',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/notify/subscription/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新通知订阅
 *
 * @param request UpdateSubscriptionRequest
 * @return UpdateSubscriptionResponse
 */
async function updateSubscription(request: UpdateSubscriptionRequest): UpdateSubscriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSubscriptionWithOptions(request, headers, runtime);
}

model UpdateUserRequest {
  clientToken?: string(name='clientToken', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
  email?: string(name='email', example='78799****@qq.com'),
  phone?: string(name='phone', example='18887878****'),
  ramId?: long(name='ramId', example='2243564'),
  roleIdList?: [ long ](name='roleIdList'),
  userId?: long(name='userId', description='This parameter is required.', example='111'),
  username?: string(name='username'),
}

model UpdateUserResponseBody = {
  requestId?: string(name='requestId', description='id of the request', example='c26f36de-1ec8-496a-a828-880676c5ef81'),
}

model UpdateUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserResponseBody(name='body'),
}

/**
 * @summary 更新用户
 *
 * @param request UpdateUserRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserResponse
 */
async function updateUserWithOptions(request: UpdateUserRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateUserResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.email)) {
    body['email'] = request.email;
  }
  if (!Util.isUnset(request.phone)) {
    body['phone'] = request.phone;
  }
  if (!Util.isUnset(request.ramId)) {
    body['ramId'] = request.ramId;
  }
  if (!Util.isUnset(request.roleIdList)) {
    body['roleIdList'] = request.roleIdList;
  }
  if (!Util.isUnset(request.userId)) {
    body['userId'] = request.userId;
  }
  if (!Util.isUnset(request.username)) {
    body['username'] = request.username;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUser',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/update`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新用户
 *
 * @param request UpdateUserRequest
 * @return UpdateUserResponse
 */
async function updateUser(request: UpdateUserRequest): UpdateUserResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateUserWithOptions(request, headers, runtime);
}

model UpdateUserGuideStatusRequest {
  clientToken?: string(name='clientToken', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
  guideAction?: string(name='guideAction', example='SERVICE_GROUP_GUIDE'),
}

model UpdateUserGuideStatusResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='FD200FAE-E98F-496E-BFE6-4CE61E59A2E9'),
}

model UpdateUserGuideStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserGuideStatusResponseBody(name='body'),
}

/**
 * @summary 更新用户新手引导状态
 *
 * @param request UpdateUserGuideStatusRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserGuideStatusResponse
 */
async function updateUserGuideStatusWithOptions(request: UpdateUserGuideStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateUserGuideStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.guideAction)) {
    body['guideAction'] = request.guideAction;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUserGuideStatus',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/user/update/guide/status`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新用户新手引导状态
 *
 * @param request UpdateUserGuideStatusRequest
 * @return UpdateUserGuideStatusResponse
 */
async function updateUserGuideStatus(request: UpdateUserGuideStatusRequest): UpdateUserGuideStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateUserGuideStatusWithOptions(request, headers, runtime);
}

model VerifyRouteRuleRequest {
  routeRuleId?: long(name='routeRuleId', example='1111'),
  testSourceEvents?: [ 
    {
      eventJson?: string(name='eventJson', example='{}'),
      eventTime?: string(name='eventTime', example='2021-09-08 13:00:00'),
      monitorSourceId?: long(name='monitorSourceId', example='1'),
      monitorSourceName?: string(name='monitorSourceName', example='zabbix'),
    }
  ](name='testSourceEvents'),
}

model VerifyRouteRuleResponseBody = {
  data?: {
    escalationPlans?: [ 
      {
        escalationPlanId?: long(name='escalationPlanId', example='111111'),
        escalationPlanName?: string(name='escalationPlanName', example='升级计划1'),
      }
    ](name='escalationPlans'),
    isValidRule?: boolean(name='isValidRule', example='true'),
    monitorSourceIds?: [ long ](name='monitorSourceIds'),
    notifySubscriptionNames?: [ 
      {
        subscriptionId?: long(name='subscriptionId', example='111111'),
        title?: string(name='title', example='订阅名称'),
      }
    ](name='notifySubscriptionNames'),
    routeRuleFailReason?: [ string ](name='routeRuleFailReason'),
    routeType?: string(name='routeType', example='INCIDENT、ALERT'),
  }(name='data'),
  requestId?: string(name='requestId', description='Id of the request', example='xxxxxx'),
}

model VerifyRouteRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyRouteRuleResponseBody(name='body'),
}

/**
 * @summary 验证流转规则
 *
 * @param request VerifyRouteRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyRouteRuleResponse
 */
async function verifyRouteRuleWithOptions(request: VerifyRouteRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): VerifyRouteRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.routeRuleId)) {
    body['routeRuleId'] = request.routeRuleId;
  }
  if (!Util.isUnset(request.testSourceEvents)) {
    body['testSourceEvents'] = request.testSourceEvents;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'VerifyRouteRule',
    version = '2021-04-13',
    protocol = 'HTTPS',
    pathname = `/routeRule/verify`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 验证流转规则
 *
 * @param request VerifyRouteRuleRequest
 * @return VerifyRouteRuleResponse
 */
async function verifyRouteRule(request: VerifyRouteRuleRequest): VerifyRouteRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return verifyRouteRuleWithOptions(request, headers, runtime);
}

